如何在python 3.7中使用pip安装wordcloud

时间:2019-02-19 04:44:48

标签: python installation pip package

我一直试图在Windows 10上为python 3.7 pip安装wordcloud,但我一直收到此错误消息,我不太了解也无法修复。

正在为 wordcloud 运行setup.py安装:状态为“错误”

 Complete output from command "c:\program files (x86)\python37-32\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\cs33~1\\AppData\\Local\\Temp\\pip-install-ome1vxvg\\wordcloud\\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\cs33~1\AppData\Local\Temp\pip-record-cy5uj5zk\install-record.txt --single-version-externally-managed --compile --user --prefix=:
    c:\program files (x86)\python37-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)
    c:\program files (x86)\python37-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'test_requires'
      warnings.warn(msg)
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.7
    creating build\lib.win32-3.7\wordcloud
    copying wordcloud\color_from_image.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\tokenization.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\wordcloud.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\wordcloud_cli.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\_version.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\__init__.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\__main__.py -> build\lib.win32-3.7\wordcloud
    copying wordcloud\stopwords -> build\lib.win32-3.7\wordcloud
    copying wordcloud\DroidSansMono.ttf -> build\lib.win32-3.7\wordcloud
    UPDATING build\lib.win32-3.7\wordcloud/_version.py
    set build\lib.win32-3.7\wordcloud/_version.py to '1.5.0'
    running build_ext
    building 'wordcloud.query_integral_image' extension
    creating build\temp.win32-3.7
    creating build\temp.win32-3.7\Release
    creating build\temp.win32-3.7\Release\wordcloud
    C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD "-Ic:\program files (x86)\python37-32\include" "-Ic:\program files (x86)\python37-32\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.15.26726\include" /Tcwordcloud/query_integral_image.c /Fobuild\temp.win32-3.7\Release\wordcloud/query_integral_image.obj
    query_integral_image.c
    c:\program files (x86)\python37-32\include\pyconfig.h(59): fatal error C1083: Cannot open include file: 'io.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

我尝试下载wordcloud-1.3.2-cp36-cp36m-win_amd64.whl并进行python --user pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl,但该平台轮不支持该轮。 帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

两点

  • 确保您的.whl位于python / python-version文件夹下的Scripts文件夹中
  • whl是正确的版本,例如:如果32位系统whl上的python 3.7应该是library-cp37-cp37m-win32.whl