I am installing django-compressor on Windows 10 x64 with Python 3.4 x64. Я устанавливаю django-compressor в Windows 10 x64 с Python 3.4 x64. 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
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Было очень полезно.
enSame 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В файле readme @jodom rcssmin написано rcssmin.c is a reimplementation of rcssmin.py in C and improves runtime up to factor 100 or so
, так что я думаю, что функции те же, но без расширений c он работает намного медленнее.
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.
enInstalling 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, которую вы используете.
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 Ваше здоровье
Thanks, MacOS High Sierra excl. Спасибо, MacOS High Sierra искл. Xcode spam and with miniconda & python3.6 showed the same error. Спам Xcode и с 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). Для меня мне не хватало инструментов командной строки xcode на 10.13 (думал, что он был установлен, но думаю, что нет). I was able to fix the OP's issue that I also had by running xcode-select --install
Я смог исправить проблему OP, которая у меня также была, запустив xcode-select --install
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
enI 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Ура это сработало .... спасибо
enrjsmin
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
могла быть удалена в новой версии 1.1.0, выпущенной 6 марта 2019 года.
Closed issue on rjsmin
repo: https://github.com/ndparker/rjsmin/issues/15 Закрытая проблема в репозитории rjsmin
: https://github.com/ndparker/rjsmin/issues/15
см. #930
enenI 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"
@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
Самый полезный комментарий
Я смог установить его, выполнив сначала это:
en