使用Anaconda安装pygame [英] Installation of pygame with Anaconda

查看:209
本文介绍了使用Anaconda安装pygame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7 64-bit系统上安装了Anaconda 1.6.2,该计算机使用Python 2.7.5.
我需要安装Pygame 1.9.1,这不是conda repository的一部分.
我无法运行Windows installer,因为Anaconda尚未为Python创建注册表项,并且.msi无法识别Python版本.
因此,我尝试从源代码安装Pygame.我最初想要做的是按照 http://www.continuum.io/blog/conda 按照这些说明,首先从源代码安装软件包(在本例中为pygame),然后创建conda软件包.但是,我在pygame安装中失败了.
运行setup.py文件("python setup.py install")时,运行时错误
抛出"mingw32: required environment variable MINGW_ROOT_DIRECTORY not set".
设置环境变量后,我再次运行安装程序,这一次,运行时错误变为依赖关系链接到错误的Python 2.7 C运行时".

I have Anaconda 1.6.2, which uses Python 2.7.5, installed on a Windows 7 64-bit system.
I need to install Pygame 1.9.1 and this is not part of the conda repository.
I cannot run the Windows installer because Anaconda has not made registry entries for Python and the .msi does not recognize the Python version.
So, I tried to install Pygame from source. What I originally wanted to do was create a conda package as per the instructions here http://www.continuum.io/blog/conda As per those instructions, the package (pygame in this case) is first installed from source and then a conda package is created. But, I failed in the pygame install.
On running the setup.py file ("python setup.py install"), a run time error
"mingw32: required environment variable MINGW_ROOT_DIRECTORY not set" is thrown.
After setting the environment variables, I ran the setup again and this time, the runtime error became "The dependencies are linked to the wrong C runtime for Python 2.7".

错误:

WARNING, DLL for smpeg library not found.
WARNING, DLL for tiff library not found.
WARNING, DLL for SDL_ttf library not found.
WARNING, DLL for SDL_image library not found.
WARNING, DLL for vorbisfile library not found.
WARNING, DLL for jpeg library not found.
WARNING, DLL for vorbis library not found.
WARNING, DLL for SDL_mixer library not found.
WARNING, DLL for png library not found.
WARNING, DLL for SDL library not found.
WARNING, DLL for ogg library not found.
WARNING, DLL for z library not found.
WARNING, DLL for portmidi library not found.
running install
running build
running build_py
running build_ext
Traceback (most recent call last):
  File "setup.py", line 491, in <module>
    setup(**PACKAGEDATA)
  File "C:\Anaconda\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "C:\Anaconda\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Anaconda\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Anaconda\lib\distutils\command\install.py", line 563, in run
    self.run_command('build')
  File "C:\Anaconda\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Anaconda\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Anaconda\lib\distutils\command\build.py", line 127, in run
    self.run_command(cmd_name)
  File "C:\Anaconda\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Anaconda\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 352, in run
    sys.version_info[:2])
RuntimeError: The dependencies are linked to the wrong C runtime for Python 2.7

\ Anaconda \ Lib \ distutils中的distutils.cfg文件读取

The distutils.cfg file in \Anaconda\Lib\distutils reads

[build]
compiler = mingw32

请告诉我安装Pygame with Anaconda我需要做什么.我找不到有关此组合的任何信息(几乎没有任何信息).我只想补充一点,当我安装Python 2.7.5时,Pygame最初可以正常工作.现在,当我卸载原始的Python安装并移至Anaconda时,问题就出现了.

Please tell me what I need to do to install Pygame with Anaconda. I'm not able to find any information (barely any) regarding this combination. I would just like to add that Pygame was originally working when I had a Python 2.7.5 installation. The problem has come up now when I uninstalled my original Python installation and moved to Anaconda.

谢谢!

推荐答案

使用conda安装Python的最简单方法是:

The easiest way to install Python using conda is:

conda install -c https://conda.binstar.org/krisvanneste pygame

该软件包似乎不可用,但是您可以改用此软件包:

It seems like the package is unavailable, but you can use this instead:

conda install -c https://conda.anaconda.org/tlatorre python

命令已更改,现在可以使用:

The command has changed, now you can use:

conda install -c tlatorre pygame=1.9.2

tlatorre的存储库仍然有效,但是有些过时了,如果您想要最新版本,可以使用cogsci存储库:

tlatorre's repo is still valid but a little bit outdated, you can use cogsci repo if you want the latest version:

conda install -c cogsci pygame

这篇关于使用Anaconda安装pygame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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