胡鸣谦 发表于 2020-12-15 19:25:22

pip安装问题

命令:pip install wordcloud
结果:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting wordcloud
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/be/33/5bdd39587f0e8ede3fe12d9d16d6f1fb5e7a43f29621604a949ee362d013/wordcloud-1.8.1.tar.gz (220 kB)
Requirement already satisfied: numpy>=1.6.1 in d:\python3.9\lib\site-packages (from wordcloud) (1.19.4)
Requirement already satisfied: pillow in d:\python3.9\lib\site-packages (from wordcloud) (8.0.1)
Requirement already satisfied: matplotlib in d:\python3.9\lib\site-packages (from wordcloud) (3.3.3)
Requirement already satisfied: cycler>=0.10 in d:\python3.9\lib\site-packages (from matplotlib->wordcloud) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\python3.9\lib\site-packages (from matplotlib->wordcloud) (1.3.1)
Requirement already satisfied: python-dateutil>=2.1 in d:\python3.9\lib\site-packages (from matplotlib->wordcloud) (2.8.1)
Requirement already satisfied: numpy>=1.6.1 in d:\python3.9\lib\site-packages (from wordcloud) (1.19.4)
Requirement already satisfied: pillow in d:\python3.9\lib\site-packages (from wordcloud) (8.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in d:\python3.9\lib\site-packages (from matplotlib->wordcloud) (2.4.7)
Requirement already satisfied: six in c:\users\davy\appdata\roaming\python\python39\site-packages (from cycler>=0.10->matplotlib->wordcloud) (1.15.0)
Requirement already satisfied: six in c:\users\davy\appdata\roaming\python\python39\site-packages (from cycler>=0.10->matplotlib->wordcloud) (1.15.0)
Building wheels for collected packages: wordcloud
Building wheel for wordcloud (setup.py) ... error
ERROR: Command errored out with exit status 1:
   command: 'd:\python3.9\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\Davy\\AppData\\Local\\Temp\\pip-install-olyl7fn6\\wordcloud_eb60f9b582c848898d9aac3940bb7367\\setup.py'"'"'; __file__='"'"'C:\\Users\\Davy\\AppData\\Local\\Temp\\pip-install-olyl7fn6\\wordcloud_eb60f9b582c848898d9aac3940bb7367\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Davy\AppData\Local\Temp\pip-wheel-vdvogu8s'
       cwd: C:\Users\Davy\AppData\Local\Temp\pip-install-olyl7fn6\wordcloud_eb60f9b582c848898d9aac3940bb7367\
Complete output (20 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\wordcloud
copying wordcloud\color_from_image.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\tokenization.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\wordcloud.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\wordcloud_cli.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\_version.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\__init__.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\__main__.py -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\stopwords -> build\lib.win-amd64-3.9\wordcloud
copying wordcloud\DroidSansMono.ttf -> build\lib.win-amd64-3.9\wordcloud
UPDATING build\lib.win-amd64-3.9\wordcloud/_version.py
set build\lib.win-amd64-3.9\wordcloud/_version.py to '1.8.1'
running build_ext
building 'wordcloud.query_integral_image' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Failed building wheel for wordcloud
Running setup.py clean for wordcloud
Failed to build wordcloud
Installing collected packages: wordcloud
    Running setup.py install for wordcloud ... error
    ERROR: Command errored out with exit status 1:
   command: 'd:\python3.9\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\Davy\\AppData\\Local\\Temp\\pip-install-olyl7fn6\\wordcloud_eb60f9b582c848898d9aac3940bb7367\\setup.py'"'"'; __file__='"'"'C:\\Users\\Davy\\AppData\\Local\\Temp\\pip-install-olyl7fn6\\wordcloud_eb60f9b582c848898d9aac3940bb7367\\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\Davy\AppData\Local\Temp\pip-record-jd5d8uci\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python3.9\Include\wordcloud'
         cwd: C:\Users\Davy\AppData\Local\Temp\pip-install-olyl7fn6\wordcloud_eb60f9b582c848898d9aac3940bb7367\
    Complete output (20 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\color_from_image.py -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\tokenization.py -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\wordcloud.py -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\wordcloud_cli.py -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\_version.py -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\__init__.py -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\__main__.py -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\stopwords -> build\lib.win-amd64-3.9\wordcloud
    copying wordcloud\DroidSansMono.ttf -> build\lib.win-amd64-3.9\wordcloud
    UPDATING build\lib.win-amd64-3.9\wordcloud/_version.py
    set build\lib.win-amd64-3.9\wordcloud/_version.py to '1.8.1'
    running build_ext
    building 'wordcloud.query_integral_image' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\python3.9\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\Davy\\AppData\\Local\\Temp\\pip-install-olyl7fn6\\wordcloud_eb60f9b582c848898d9aac3940bb7367\\setup.py'"'"'; __file__='"'"'C:\\Users\\Davy\\AppData\\Local\\Temp\\pip-install-olyl7fn6\\wordcloud_eb60f9b582c848898d9aac3940bb7367\\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\Davy\AppData\Local\Temp\pip-record-jd5d8uci\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python3.9\Include\wordcloud' Check the logs for full command output.

hrp 发表于 2020-12-15 19:37:27

本帖最后由 hrp 于 2020-12-15 19:39 编辑

两种办法,选其一:
1.去http://www.lfd.uci.edu/~gohlke/pythonlibs/下载已编译好的模块,用pip 文件名本地安装
2.安装visualstudio 2019并在其中启用c++工作负载,完成后再尝试重新pip安装该模块
页: [1]
查看完整版本: pip安装问题