【问题标题】:Cannot install modules using pip - it gives an error无法使用 pip 安装模块 - 它给出了错误
【发布时间】:2020-10-07 06:25:50
【问题描述】:

我卸载了 Python 3.8,然后安装了 Python 3.9。

现在,当我尝试使用 pip 安装任何模块时:

pip install pygame

它显示了这个错误:

ERROR: Command errored out with exit status 1:
     command: 'c:\users\acer\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-s3fy0toj\\pygame\\setup.py'"'"'; __file__='"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-s3fy0toj\\pygame\\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\Acer\AppData\Local\Temp\pip-pip-egg-info-lgmfm8yh'
         cwd: C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\
    Complete output (17 lines):


    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using WINDOWS configuration...


    Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\setup.py", line 194, in <module>
        buildconfig.config.main(AUTO_CONFIG)
      File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\config.py", line 210, in main
        deps = CFG.main(**kwds)
      File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\config_win.py", line 576, in main
        and download_win_prebuilt.ask(**download_kwargs):
      File "C:\Users\Acer\AppData\Local\Temp\pip-install-s3fy0toj\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
        reply = raw_input(
    EOFError: EOF when reading a line
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我尝试再次卸载和安装 Python,但仍然没有成功。我在使用 Python 3.8 时没有遇到这样的问题

当我尝试安装 Django 时,它可以工作,但后来我尝试安装 Pandas,但它没有工作。

请帮忙。

【问题讨论】:

  • 你输入了什么 pip 命令?
  • 我输入了pip install pygame
  • 不要只粘贴错误,而是考虑发布您实际运行的命令。
  • @Pythony ,您在安装 python 3.8 时是否对环境变量的文件路径/目录进行了任何设置?或者你只是在安装过程中点击了添加到路径
  • @Ice Bear, ,我不记得了,但是当我检查环境变量时,没有python 3.8的环境变量

标签: python-3.x installation pip pygame python-3.9


【解决方案1】:

我认为python3.9存在一些兼容性问题。

更多信息,您可以查看此链接。

https://github.com/pygame/pygame/issues/2145

【讨论】:

  • 应该可以。暂时只用python 3.8。
  • 所以我无法在 Python 3.9 中使用它
  • 感谢您的帮助,我卸载了 Python 3.9 并重新安装了 Python 3.8,它成功了!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-06-16
  • 1970-01-01
  • 1970-01-01
  • 2020-12-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多