使用pipwin在Windows 10上安装matplotlib的问题

问题描述

我正在尝试按照this answer中带有matplotlib的说明,在Windows 10(64位)Python版本3.9上安装pipwin。我查看了Christoph Gohlke的website,似乎已经找到了合适的版本。在此之前,我安装了numpyscipy:两者都成功。

我不明白为什么matplotlib安装失败。

这是产生的错误

ERROR: Command errored out with exit status 1:
     command: 'c:\program files\python39\python.exe' -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'C:\\Users\\Ayon\\AppData\\Local\\Temp\\pip-install-lshx07yt\\kiwisolver\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ayon\\AppData\\Local\\Temp\\pip-install-lshx07yt\\kiwisolver\\setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Ayon\AppData\Local\Temp\pip-pip-egg-info-t2ll_1bu'
         cwd: C:\Users\Ayon\AppData\Local\Temp\pip-install-lshx07yt\kiwisolver\
    Complete output (44 lines):
    WARNING: The wheel package is not available.
      ERROR: Command errored out with exit status 1:
       command: 'c:\program files\python39\python.exe' -u -c 'import sys,tokenize; sys.argv[0] = '"'"'C:\\Users\\Ayon\\AppData\\Local\\Temp\\pip-wheel-53baidv2\\cppy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ayon\\AppData\\Local\\Temp\\pip-wheel-53baidv2\\cppy\\setup.py'"'"';f=getattr(tokenize,'"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Ayon\AppData\Local\Temp\pip-wheel-z0wi26qr'
           cwd: C:\Users\Ayon\AppData\Local\Temp\pip-wheel-53baidv2\cppy\
      Complete output (6 lines):
      usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: setup.py --help [cmd1 cmd2 ...]
         or: setup.py --help-commands
         or: setup.py cmd --help

      error: invalid command 'bdist_wheel'
      ----------------------------------------
      ERROR: Failed building wheel for cppy
    ERROR: Failed to build one or more wheels
    Traceback (most recent call last):
      File "c:\program files\python39\lib\site-packages\setuptools\installer.py",line 128,in fetch_build_egg
        subprocess.check_call(cmd)
      File "c:\program files\python39\lib\subprocess.py",line 373,in check_call
        raise CalledProcessError(retcode,cmd)
    subprocess.CalledProcessError: Command '['c:\\program files\\python39\\python.exe','-m','pip','--disable-pip-version-check','wheel','--no-deps','-w','C:\\Users\\Ayon\\AppData\\Local\\Temp\\tmpobepce7l','--quiet','cppy>=1.1.0']' returned non-zero exit status 1.

解决方法

执行以下手动安装。

pip install matplotlib‑3.3.2‑cp39‑cp39‑win_amd64.whl