【问题标题】:Python pip issuePython点问题
【发布时间】:2021-01-26 16:24:17
【问题描述】:

当我尝试使用 pip (pip install matplotlib) 安装一个简单的 matplotlib 包时,它给了我一个巨大的错误,我在任何地方都找不到解决方案。我正在使用 windows 10 64bit,最新的 python 版本,我只是不明白出了什么问题。这是一个非常大的错误,我不能把它放在这里展示,但是有一行它说:“车轮包不可用”,所以也许这会有所帮助。也许我需要安装一些东西,还想提一下我完全(或者可能没有)从我的计算机中删除了 python,然后安装了最新版本,这就是问题开始的时候。 编辑:有一百行错误,但这是它的底部,它说 - 上述异常是导致以下异常的直接原因:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\AlexPC\AppData\Local\Temp\pip-install-xkuzj3qc\matplotlib\setup.py", line 242, in <module>
    setup(  # Finally, pass this all along to distutils to do the heavy lifting.
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 164, in setup
    _install_setup_requires(attrs)
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\setuptools\__init__.py", line 159, in _install_setup_requires
    dist.fetch_build_eggs(dist.setup_requires)
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 699, in fetch_build_eggs
    resolved_dists = pkg_resources.working_set.resolve(
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\pkg_resources\__init__.py", line 779, in resolve
    dist = best[req.key] = env.best_match(
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1064, in best_match
    return self.obtain(req, installer)
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\pkg_resources\__init__.py", line 1076, in obtain
    return installer(requirement)
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\setuptools\dist.py", line 758, in fetch_build_egg
    return fetch_build_egg(self, req)
  File "c:\users\alexpc\appdata\local\programs\python\python39\lib\site-packages\setuptools\installer.py", line 130, in fetch_build_egg
    raise DistutilsError(str(e)) from e
distutils.errors.DistutilsError: Command '['c:\\users\\alexpc\\appdata\\local\\programs\\python\\python39\\python.exe', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 'C:\\Users\\AlexPC\\AppData\\Local\\Temp\\tmp_g7reglj', '--quiet', 'numpy>=1.15']' returned non-zero exit status 1.

Edit setup.cfg to change the build options; suppress output with --quiet.

BUILDING MATPLOTLIB
  matplotlib: yes [3.3.2]
      python: yes [3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC
                  v.1927 64 bit (AMD64)]]
    platform: yes [win32]
 sample_data: yes [installing]
       tests: no  [skipping due to configuration]
      macosx: no  [Mac OS-X only]

----------------------------------------

错误:命令出错,退出状态为 1:python setup.py egg_info 检查日志以获取完整的命令输出。

【问题讨论】:

  • 首先尝试pip install wheel,但请发布完整的跟踪信息。或距底部约 50-60 行
  • 添加更多问题的上下文。也许您想添加堆栈跟踪。
  • @venky__ 我编辑了帖子,老实说我根本不明白这个问题,我也只是一个新手,所以是的,希望你能帮助我
  • 你是否执着于使用 python 3.9?如果没有,那么我建议切换到其他版本,其中预构建的二进制文件可用于所有标准包。

标签: python windows pip package


【解决方案1】:

Python 3.9 是非常新的版本,许多第 3 方包还没有支持 Python 3.9 的二进制文件。检查 here 是否有 matplotlib 的轮子。如果没有下载 3.8 Python 版本。

[以下也可能有效]

pip install pipwin

pipwin install matplotlib

【讨论】:

  • 我正在跟进,这是否解决了您的问题,还是对您没有任何帮助?
猜你喜欢
  • 1970-01-01
  • 2013-09-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-11-23
  • 2020-10-16
  • 2015-02-13
  • 1970-01-01
相关资源
最近更新 更多