为matplotlib构建控制盘时,安装pdpbox时出现问题

2024-09-24 00:24:33 发布

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

我正在用Windows10和Python3.8在本地计算机上安装pdpbox。它尝试安装matplotlib 3.1.1,然后尝试使用当前的matplotlib 3.3.4。它给出了一条错误消息

发生以下情况:

Building wheels for collected packages: matplotlib
  Building wheel for matplotlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\juanc\\AppData\\Local\\Temp\\pip-install-bl7sj8y8\\matplotlib_af49ebe1097845999252c2ef2a680b4e\\setup.py'"'"'; __file__='"'"'C:\\Users\\juanc\\AppData\\Local\\Temp\\pip-install-bl7sj8y8\\matplotlib_af49ebe1097845999252c2ef2a680b4e\\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\juanc\AppData\Local\Temp\pip-wheel-iem_yn01'
       cwd: C:\Users\juanc\AppData\Local\Temp\pip-install-bl7sj8y8\matplotlib_af49ebe1097845999252c2ef2a680b4e\
  Complete output (499 lines):
  ================================================================================
  Edit setup.cfg to change the build options

  BUILDING MATPLOTLIB
    matplotlib: yes [3.1.1]
        python: yes [3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC
                    v.1924 64 bit (AMD64)]]
      platform: yes [win32]

  OPTIONAL SUBPACKAGES
   sample_data: yes [installing]
         tests: no  [skipping due to configuration]

  OPTIONAL BACKEND EXTENSIONS
           agg: yes [installing]
         tkagg: yes [installing; run-time loading from Python Tcl/Tk]
        macosx: no  [Mac OS-X only]

  OPTIONAL PACKAGE DATA
          dlls: no  [skipping due to configuration]

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.8
  copying lib\pylab.py -> build\lib.win-amd64-3.8
  creating build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\afm.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\animation.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\artist.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\axis.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\backend_bases.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\backend_managers.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\backend_tools.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\bezier.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\blocking_input.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\category.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\cm.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\collections.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\colorbar.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\colors.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\container.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\contour.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\dates.py -> build\lib.win-amd64-3.8\matplotlib
  copying lib\matplotlib\docstring.py -> build\lib.win-amd64-3.8\matplotlib

  ...

  copying lib\matplotlib\backends\web_backend\jquery-ui-1.12.1\jquery-ui.js -> build\lib.win-amd64-3.8\matplotlib\backends\web_backend\jquery-ui-1.12.1
  copying lib\matplotlib\mpl-data\fonts\afm\cmex10.afm -> build\lib.win-amd64-3.8\matplotlib\mpl-data\fonts\afm
  copying lib\matplotlib\mpl-data\fonts\ttf\LICENSE_STIX -> build\lib.win-amd64-3.8\matplotlib\mpl-data\fonts\ttf
  copying lib\matplotlib\mpl-data\stylelib\classic.mplstyle -> build\lib.win-amd64-3.8\matplotlib\mpl-data\stylelib
  copying lib\matplotlib\mpl-data\images\filesave.pdf -> build\lib.win-amd64-3.8\matplotlib\mpl-data\images
  copying lib\matplotlib\backends\web_backend\nbagg_uat.ipynb -> build\lib.win-amd64-3.8\matplotlib\backends\web_backend
  UPDATING build\lib.win-amd64-3.8\matplotlib\_version.py
  set build\lib.win-amd64-3.8\matplotlib\_version.py to '3.1.1'
  running build_ext
  building 'matplotlib.ft2font' 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 matplotlib
  Running setup.py clean for matplotlib
Failed to build matplotlib
Installing collected packages: matplotlib, pdpbox
  Attempting uninstall: matplotlib
    Found existing installation: matplotlib 3.3.4
    Uninstalling matplotlib-3.3.4:
      Successfully uninstalled matplotlib-3.3.4
    Running setup.py install for matplotlib ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\juanc\\AppData\\Local\\Temp\\pip-install-bl7sj8y8\\matplotlib_af49ebe1097845999252c2ef2a680b4e\\setup.py'"'"'; __file__='"'"'C:\\Users\\juanc\\AppData\\Local\\Temp\\pip-install-bl7sj8y8\\matplotlib_af49ebe1097845999252c2ef2a680b4e\\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\juanc\AppData\Local\Temp\pip-record-bd1ttf50\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\matplotlib'
         cwd: C:\Users\juanc\AppData\Local\Temp\pip-install-bl7sj8y8\matplotlib_af49ebe1097845999252c2ef2a680b4e\
    
SAME HAPPENS HERE AS ABOVE

ERROR: Command errored out with exit status 1: 'c:\python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\juanc\\AppData\\Local\\Temp\\pip-install-bl7sj8y8\\matplotlib_af49ebe1097845999252c2ef2a680b4e\\setup.py'"'"'; __file__='"'"'C:\\Users\\juanc\\AppData\\Local\\Temp\\pip-install-bl7sj8y8\\matplotlib_af49ebe1097845999252c2ef2a680b4e\\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\juanc\AppData\Local\Temp\pip-record-bd1ttf50\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python38\Include\matplotlib' Check the logs for full command output.

有没有人有过类似的问题?我不知道如何避免pdp寻找旧版本的matplotlib。也可能是配置问题。谢谢


Tags: installpippybuildmatplotlibliblocalsetup