安装Pygame时Python pip3 egg_info错误代码1 [英] Python pip3 egg_info error code 1 while installing Pygame

查看:143
本文介绍了安装Pygame时Python pip3 egg_info错误代码1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近有python 3.6,正在安装python软件包.到目前为止,请求一直有效,但对于pygame,我收到一个错误:

I have recently got python 3.6 and I am installing python packages. So far requests has worked but for pygame, I get an error:

 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".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Nicholas\AppData\Local\Temp\pip-build-xufd58ed\pygame\setup.py", line 165, in <module>
    extensions = read_setup_file('Setup')
  File "c:\program files\python36\lib\distutils\extension.py", line 171, in read_setup_file
    line = expand_makefile_vars(line, vars)
  File "c:\program files\python36\lib\distutils\sysconfig.py", line 410, in expand_makefile_vars
    s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: must be str, not NoneType

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Nicholas\AppData\Local\Temp\pip-build-xufd58ed\pygame\

在安装其他软件包(如熊猫)时,我遇到了与此类似的错误 错误可能是软件包尚未准备好用于python 3.6或其他东西吗? 我正在运行Windows 10 64bit

I have had errors similar to this when installing other packages such as pandas Could the error be that the packages are not yet ready for python 3.6 or somthing else? I am running windows 10 64bit

请帮忙,尼克

推荐答案

我遇到了与您相同的问题.

I had the same problem as you.

转到此页面: http://www.lfd.uci. edu/〜gohlke/pythonlibs/#pygame 并下载适合您的 Python Windows 版本的.whl文件.

Go to this page: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame and download the .whl file that suits your Python and Windows version.

在我的情况下为pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl,因为我使用的是 Python 3.6.0 Windows 64位.

In my case it's pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl since I use Python 3.6.0 and Windows 64-bit.

下一步,在任务栏上的搜索框中输入cmd,然后按Enter.将打开一个命令窗口.

Next, enter cmd in the search box on your taskbar and press enter. A command window will open.

在cmd中输入以下内容:

Enter the following into the cmd:

pip install setuptools
pip install wheel
pip install --upgrade setuptools
pip install --upgrade wheel

然后在安装pygame时有两个选择:

You then have two options when installing pygame:

将您先前下载的文件粘贴到Python文件夹中(在我的情况下为 C:\Python).

Paste the file you downloaded earlier in the Python folder (in my case it's C:\Python).

如果下载了pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl,请使用以下命令安装pygame:

If you downloaded pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl, install pygame with:

pip install pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl

(否则,将pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl更改为您下载的文件的名称).

(Or else change pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl to the name of the file you downloaded, if it is different to mine).

在输入上一个命令之前,请确保下载的文件位于Python文件夹中(在我的情况下为 C:\Python\pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl),并且复制了整个文件名,包括扩展名.whl否则它将无法正常工作.

Before you enter the previous command, make sure the file you downloaded is in the Python folder (in my case, C:\Python\pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl) and you copied the whole file name including the .whl extension or else it won't work.

将您先前下载的文件粘贴到桌面上.

Paste the file you downloaded earlier on your desktop.

如果将.whl文件放在桌面上,请输入以下内容来更改当前目录:

If you placed your .whl file on your desktop, enter this to change your current directory:

cd "C:\Users\(your_username)\Desktop"

然后,如果您下载了pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl,请使用以下命令安装pygame:

Then, if you downloaded pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl, install pygame with:

pip install pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl

(或者将pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl更改为您下载的文件的名称,如果与我的名称不同).

(Or else change pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl to the name of the file you downloaded, if it is different to mine).

在输入上一个命令之前,请确保更改当前目录并复制了整个文件名,包括.whl扩展名,否则它将不起作用

Before you enter the previous command, make sure you change your current directory and you copied the whole file name including the .whl extension or else it won't work

这应该安装pygame 1.9.2并可以在Python 3.6.0上运行.

This should install pygame 1.9.2 and work on Python 3.6.0.

这篇关于安装Pygame时Python pip3 egg_info错误代码1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆