I am installing django-compressor on Windows 10 x64 with Python 3.4 x64. Python3.4x64を使用するWindows10x64に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.興味深いことに、Python3.5x64ではこのようなエラーは発生しませんでした。
> 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. Linuxmint18にインストールしようとすると同じ問題が発生します。
_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のreadmeには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これは、以前は別のmint18VMに問題なくインストールしていたことを考慮しています。
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.私はPython3.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.ありがとう、MacOSHighSierraを除く。 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).私の場合、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の問題を修正することができました。
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
のインストールオプションは、2019年3月6日にリリースされた新しい1.1.0リリースで削除された可能性があります。
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