微软Visual C++ 14是必需的。下载python包时出错

2024-06-16 13:05:21 发布

您现在位置:Python中文网/ 问答频道 /正文

当我试图在我的django项目中下载python包“pip install django compressor”时,它给出了这个错误。那么,如何解决这个错误呢?在

PS C:\Users\HP\Desktop\acornaccounting> pip install django-compressor
Collecting django-compressor
  Using cached https://files.pythonhosted.org/packages/02/7b/deb4605f95bcefb9760ff130533553230a1c25f4d383ed0735b075d71b29/django_compressor-2.2-py2.py3-none-any.whl
Requirement already satisfied: django-appconf>=1.0 in c:\users\hp\appdata\local\programs\python\python36\lib\site-packages (from django-compressor) (1.0.2)
Collecting rjsmin==1.0.12 (from django-compressor)
  Using cached https://files.pythonhosted.org/packages/10/9c/2c45f57d43258b05bf33cf8f6c8161ea5abf8b4776a5c59d12646727cd98/rjsmin-1.0.12.tar.gz
Collecting rcssmin==1.0.6 (from django-compressor)
  Using cached https://files.pythonhosted.org/packages/e2/5f/852be8aa80d1c24de9b030cdb6532bc7e7a1c8461554f6edbe14335ba890/rcssmin-1.0.6.tar.gz
Installing collected packages: rjsmin, rcssmin, django-compressor
  Running setup.py install for rjsmin ... error
    Complete output from command c:\users\hp\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\HP\\AppData\\Local\\Temp\\pip-install-i9yu03ey\\rjsmin\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\HP\AppData\Local\Temp\pip-record-sb4anuu2\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    copying .\rjsmin.py -> build\lib.win-amd64-3.6
    running build_ext
    building '_rjsmin' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

Tags: installpipdjangofrompybuildpackagescompressor
1条回答
网友
1楼 · 发布于 2024-06-16 13:05:21

试试这个,

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

这个解决方案工作得很好,但是如果没有c扩展,它的工作速度会慢得多。

所以更好的解决方案是,Intstall C++ dependencies,大小为1.1GB

相关问题 更多 >