python - 安装 pygame python setup.py egg_info 时出错
问题描述
似乎问题出在设置路径中?谁能告诉我如何理解我的错误?它不会让我安装 pygame。这是我输入后的终端窗口输出python -m pip install --user pygame
。
Collecting pygame
Using cached https://files.pythonhosted.org/packages/b2/6b/c510f0853765eb2219ca5aa3d416d65bb0dea7cd9bb2984aea0a0e04c24d/pygame-1.9.4.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
C:\Users\Joshua\AppData\Local\Temp\pip-install-b12x3pbp\pygame\setup.py:321: SyntaxWarning: invalid escape sequence \d
return ', '.join(s for s in findall('\d+', ver)[0:3])
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Joshua\AppData\Local\Temp\pip-install-b12x3pbp\pygame\setup.py", line 203, in <module>
extensions = read_setup_file('Setup')
File "C:\Users\Joshua\Desktop\Python 3.7\lib\distutils\extension.py", line 171, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Users\Joshua\Desktop\Python 3.7\lib\distutils\sysconfig.py", line 405, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: can only concatenate str (not "NoneType") to str
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Joshua\AppData\Local\Temp\pip-install-b12x3pbp\pygame\
解决方案
尝试以下操作:
python3 -m pip install -U pygame --user
或者
python -m pip install
如果这些工作都没有尝试这个问题,答案应该标记在问题下方。我认为你有同样的问题
推荐阅读
- java - RxJava 全局处理程序和 Android Vitals
- javascript - React:反向函数在映射数组时不起作用
- reactjs - 使用 react-router 以编程方式导航时,IE 抛出 DATACloneError
- python - Discord.Role 的格式
- python - 如何在函数中打印变量类类型的实际名称?
- spring - 使用 isEmpty 进行条件查询的子树意外结束
- java - 如何为以下查询创建 jpa 规范或条件查询的谓词
- javascript - “材料表” - 如何在每页添加更多行并修复渲染 - ReactJs
- google-earth-engine - 如何让 ee.Reducer.mean() 给我一个浮点数而不是二进制数?
- javascript - 如何将值从函数插入到变量javascript