鬼才 发表于 2021-8-16 23:21:20

pip安装wordcloud报错求解

错误信息如下
ERROR: Command errored out with exit status 1:
   command: 'e:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\Michael\\AppData\\Local\\Temp\\pip-install-neurk7o6\\wordcloud_4cc1f53532234d90a7f90dd19b7fdf74\\setup.py'"'"'; __file__='"'"'C:\\Users\\Michael\\AppData\\Local\\Temp\\pip-install-neurk7o6\\wordcloud_4cc1f53532234d90a7f90dd19b7fdf74\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Michael\AppData\Local\Temp\pip-record-490m96uh\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\python\Include\wordcloud'
         cwd: C:\Users\Michael\AppData\Local\Temp\pip-install-neurk7o6\wordcloud_4cc1f53532234d90a7f90dd19b7fdf74\
    Complete output (70 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
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Michael\AppData\Local\Temp\pip-install-neurk7o6\wordcloud_4cc1f53532234d90a7f90dd19b7fdf74\setup.py", line 9, in <module>
      setup(
      File "e:\python\lib\site-packages\setuptools\__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
      File "e:\python\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
      File "e:\python\lib\distutils\dist.py", line 966, in run_commands
      self.run_command(cmd)
      File "e:\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
      File "e:\python\lib\site-packages\setuptools\command\install.py", line 61, in run
      return orig.install.run(self)
      File "e:\python\lib\distutils\command\install.py", line 546, in run
      self.run_command('build')
      File "e:\python\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "e:\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
      File "e:\python\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
      File "e:\python\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "e:\python\lib\distutils\dist.py", line 985, in run_command
      cmd_obj.run()
      File "e:\python\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
      _build_ext.run(self)
      File "e:\python\lib\distutils\command\build_ext.py", line 340, in run
      self.build_extensions()
      File "e:\python\lib\distutils\command\build_ext.py", line 449, in build_extensions
      self._build_extensions_serial()
      File "e:\python\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
      self.build_extension(ext)
      File "e:\python\lib\site-packages\setuptools\command\build_ext.py", line 196, in build_extension
      _build_ext.build_extension(self, ext)
      File "e:\python\lib\distutils\command\build_ext.py", line 529, in build_extension
      objects = self.compiler.compile(sources,
      File "e:\python\lib\distutils\_msvccompiler.py", line 323, in compile
      self.initialize()
      File "e:\python\lib\distutils\_msvccompiler.py", line 220, in initialize
      vc_env = _get_vc_env(plat_spec)
      File "e:\python\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
      return _msvc14_get_vc_env(plat_spec)
      File "e:\python\lib\site-packages\setuptools\msvc.py", line 265, in _msvc14_get_vc_env
      vcvarsall, vcruntime = _msvc14_find_vcvarsall(plat_spec)
      File "e:\python\lib\site-packages\setuptools\msvc.py", line 220, in _msvc14_find_vcvarsall
      _, best_dir = _msvc14_find_vc2017()
      File "e:\python\lib\site-packages\setuptools\msvc.py", line 192, in _msvc14_find_vc2017
      path = subprocess.check_output([
    AttributeError: 'str' object has no attribute 'decode'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'e:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv = '"'"'C:\\Users\\Michael\\AppData\\Local\\Temp\\pip-install-neurk7o6\\wordcloud_4cc1f53532234d90a7f90dd19b7fdf74\\setup.py'"'"'; __file__='"'"'C:\\Users\\Michael\\AppData\\Local\\Temp\\pip-install-neurk7o6\\wordcloud_4cc1f53532234d90a7f90dd19b7fdf74\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Michael\AppData\Local\Temp\pip-record-490m96uh\install-record.txt' --single-version-externally-managed --compile --install-headers 'e:\python\Include\wordcloud' Check the logs for full command output

现在用的版本是Python3.9
pip也已经升级到最新的版本了
不管是安装whl还是直接pip都报错,实在是没办法了,求解大佬们

鬼才 发表于 2021-8-16 23:22:27

https://imgtu.com/i/ffHs9f
报错图片

叼辣条闯世界 发表于 2021-8-18 20:42:06

"e:\python\lib\site-packages\setuptools\msvc.py" 第192有问题
页: [1]
查看完整版本: pip安装wordcloud报错求解