Install Pygame with Anaconda

余生颓废 提交于 2021-02-11 15:37:37

问题


I'm trying to install pygame on my Mac and get a ton of errors. I'm not 100% sure what this is telling me, except that it's telling me a lot.

Is it saying that Pygame is only compatible with Python 3.5? Because there was another ticket on StackOverflow (Install pygame with anaconda on mac) that said there was a problem with Python 3.5. I'd be surprised if it was incompatible with 3.7.

And if it's not incompatible, what's the problem? Everything I find seems to be quite Windows-centric with its problems and solutions.

% conda install -c cogsci pygame
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: - 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                          

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - pygame -> python[version='2.7.*|3.5.*']

Your python: python=3.7

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

回答1:


You should use pip install pygame instead. The pygame package hosted by cogsci hasn't been updated in close to 4 years. That's the reason it still only supports python 2.7 and 3.5




回答2:


On OS X with Anaconda I got pygame to work in a terminal with:

conda activate

pip install pygame



来源:https://stackoverflow.com/questions/61296202/install-pygame-with-anaconda

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!