Django-compressor: rcssmin 和 rjsmin 不安装

创建于 2016-11-02  ·  20评论  ·  资料来源: django-compressor/django-compressor

I am installing django-compressor on Windows 10 x64 with Python 3.4 x64.我正在使用 Python 3.4 x64 在 Windows 10 x64 上安装 django-compressor。 I get the following error when I install it with pip.使用 pip 安装时出现以下错误。 Interestingly enough, I did not get such an error with Python 3.5 x64.有趣的是,我在 Python 3.5 x64 中没有遇到这样的错误。

>  pip install django-compressor --upgrade
Collecting django-compressor
  Using cached django_compressor-2.1-py2.py3-none-any.whl
Collecting rjsmin==1.0.12 (from django-compressor)
  Using cached rjsmin-1.0.12.tar.gz
Collecting rcssmin==1.0.6 (from django-compressor)
  Using cached rcssmin-1.0.6.tar.gz
Requirement already up-to-date: django-appconf>=1.0 in d:\env3\lib\site-packages (from django-compressor)
Building wheels for collected packages: rjsmin, rcssmin
  Running setup.py bdist_wheel for rjsmin ... error
  Complete output from command d:\env\scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rjsmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d \Temp\tmp6dj8tx90pip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.4
  copying .\rjsmin.py -> build\lib.win-amd64-3.4
  running build_ext
  building '_rjsmin' extension
  error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

  ----------------------------------------
  Failed building wheel for rjsmin
  Running setup.py clean for rjsmin
  Running setup.py bdist_wheel for rcssmin ... error
  Complete output from command d:\env3\scriptspython.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rcssmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d \Temp\tmp_cfj9vrjpip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.4
  copying .\rcssmin.py -> build\lib.win-amd64-3.4
  running build_ext
  building '_rcssmin' extension
  error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

  ----------------------------------------
  Failed building wheel for rcssmin
  Running setup.py clean for rcssmin
Failed to build rjsmin rcssmin
Installing collected packages: rjsmin, rcssmin, django-compressor
  Running setup.py install for rjsmin ... error
    Complete output from command d:\env3\scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rjsmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record \Temp\pip-_z23ysr6-record\install-record.txt --single-version-externally-managed --compile --install-headers d:\env3\include\site\python3.4\rjsmin:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.4
    copying .\rjsmin.py -> build\lib.win-amd64-3.4
    running build_ext
    building '_rjsmin' extension
    error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279

    ----------------------------------------
Command "d:\env3\scripts\python.exe -u -c "import setuptools, tokenize;__file__='\\Temp\\pip-build-um3ph8qp\\rjsmin\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record \Temp\pip-_z23ysr6-record\install-record.txt --single-version-externally-managed --compile --install-headers d:\env3\include\site\python3.4\rjsmin" failed with error code 1 in \Temp\pip-build-um3ph8qp\rjsmin\

en

最有用的评论

我可以通过先执行以下操作来安装它:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade
en

所有20条评论

我可以通过先执行以下操作来安装它:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade
en

that sounds about right.听起来不错。 they have some c code they try to compile, but there was no compiler installed on your system.他们尝试编译一些 c 代码,但您的系统上没有安装编译器。 they could provide a better error message, see here: https://github.com/ndparker/rcssmin/issues/4他们可以提供更好的错误消息,请参见此处: https ://github.com/ndparker/rcssmin/issues/4

we could theoretically make rcssmin and rjsmin non-mandatory (also discussed here #803), but i think it's nice to have some installed by default.我们理论上可以使 rcssmin 和 rjsmin 成为非强制性的(也在这里讨论 #803),但我认为默认安装一些是很好的。 if you think otherwise, you can open a ticket for that if you want.如果您不这么认为,您可以根据需要为此开张票。

en

非常有用。

en

Same issue trying to install in linux mint 18.尝试在 linux mint 18 中安装同样的问题。

_setup/include/cext.h:34:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

@karyon how does installing without the c extensions affect the functionality? @karyon没有 c 扩展的安装如何影响功能?

en

@jodom rcssmin 的自述文件说rcssmin.c is a reimplementation of rcssmin.py in C and improves runtime up to factor 100 or so ,所以我想功能是相同的,但是如果没有 c 扩展,它的工作速度要慢得多。

en

oh great, I've managed to install it following your tip above.哦,太好了,我已经按照上面的提示安装了它。 Should I have any issues then ill try to reinstall it with the c extensions.如果我有任何问题,那么我会尝试使用 c 扩展重新安装它。 This is considering that previously I had it installing just fine in a different mint 18 VM这是考虑到以前我在不同的 mint 18 VM 中安装得很好

en

Installing python3.6-dev fixed it for me.安装python3.6-dev为我修复了它。 I'm using Python 3.6, so substitute the version number with whatever version of Python you're using.我使用的是 Python 3.6,所以用你使用的任何版本的 Python 替换版本号。

en

The real solution is installing python3-dev package.真正的解决方案是安装python3-dev包。 After sudo apt-get install python3-dev i was able to get it.sudo apt-get install python3-dev之后,我能够得到它。 Cheers干杯

en

Thanks, MacOS High Sierra excl.谢谢,MacOS High Sierra 不包括。 Xcode spam and with miniconda & python3.6 showed the same error. Xcode spam 和 miniconda & python3.6 显示相同的错误。

en

我尝试了以下方法并且有效:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
en

For me, I was missing xcode command line tools on 10.13 (thought it was installed, but guess not).对我来说,我在 10.13 上缺少 xcode 命令行工具(以为它已安装,但猜不出来)。 I was able to fix the OP's issue that I also had by running xcode-select --install我能够通过运行xcode-select --install来解决我也遇到的 OP 问题

en

I was able to get it to install by doing this first:我可以通过先执行以下操作来安装它:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade

I was able to get it to install by doing this first:我可以通过先执行以下操作来安装它:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"
pip install django-compressor --upgrade
en

超级鲍...

en

万岁,它起作用了....谢谢

en

rjsmin the install-option="--without-c-extensions" is no longer required. rjsmin install-option="--without-c-extensions"不再需要。

It looks like the install option for rjsmin may have been removed in the new 1.1.0 release released March 6th 2019.看起来rjsmin的安装选项可能已在 2019 年 3 月 6 日发布的新 1.1.0 版本中删除。

Closed issue on rjsmin repo: https://github.com/ndparker/rjsmin/issues/15 rjsmin repo 上的已关闭问题: https ://github.com/ndparker/rjsmin/issues/15

en

见#930

en

I have tried the following and it works:我尝试了以下方法并且有效:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin --install-option="--without-c-extensions"

New rjsmin doesn't work with that option at the moment新的 rjsmin 目前不适用于该选项
error:错误:
error: option --without-c-extensions not recognized
If you have that problem you can set the version:如果你有这个问题,你可以设置版本:
pip install rjsmin==1.0.12 --install-option="--without-c-extensions"

en

@brmley如上所述,您现在应该可以简单地忽略该选项,无需安装旧版本。

en

对我有用的最后命令:

pip install rcssmin --install-option="--without-c-extensions"
pip install rjsmin 
pip install django-compressor --upgrade
en

apt-get install python3.7-dev - 似乎依赖于这个库并解决了我的问题

en
此页面是否有帮助?
0 / 5 - 0 等级