I tried to install pygame via pip but this fails. Based on my google searches, it sounds like easy_install also fails.
I also checked out: http://www.pygame.org/wiki/MacLionCompile but the solution is incomplete.
I'm running python 2.7.1 bundled with Lion.
Suggestions? Appreciate the help.
You could try the binary package for Lion, available on the pygame website.
It worked for me (OSX 10.7.1 with bundled Python 2.7.1)
See the answer from this question: PyGame in a virtualenv on OS X with brew?
Essentially, the PyGame in PyPy hasn't been updated for a while.
The version in the repository has updated build scripts that handle Pythonbrew, virtualenv and other utilities.
The pip command to use is:
pip install hg+http://bitbucket.org/pygame/pygame
Just for the sake of anyone that googles this question, my lab has a wiki set up with instructions for installing Pygame with just about any configuration:
http://smash.psych.nyu.edu/labwiki/PyGameSetup
I had good luck with macports:
Install macports if you don't already have it: http://www.macports.org/
Install python via macports: sudo port install python26. I typed in the command it said at the end to set it as my default python installation. If you don't, then in step 4 you'll have to run the app a different way.
Install pygame: sudo port install py26-game
Run your pygame app: python main.py
I have been looking for this for myself and I stumbled upon this build that happens to work. I am using OSX 10.8.3 and python 2.7.
http://inside.catlin.edu/moodle/mod/resource/view.php?id=16736
Related
I have been trying to install pygame for 3.3 and 3.4 and can't find a way to install it probably with out it giving a error when I do pygame.init().
Is it because pygame.init() is not the proper code or is it because I installed it incorrectly? If so, can someone tell me how to install it?
You can find binary installations for pygame for python 3.4 on windows here. I'm not sure where you could find it if you're running a different operating system.
Check out downloads on their bitbucket repo (for windows):
https://bitbucket.org/pygame/pygame/downloads
On Windows: open your comandline and type:
pip install pygame
On Debian-based Linux type into your terminal:
sudo apt-get install python-pygame
I would recommend Gohlke's precompiled pythonlibs in wheel format :) pygame from Gohlke
I was never let down by those libraries and I used numpy, scipy, scikit-learn etc. (and pygame as well) extensively, which are one of the tougher to build on windows ;)
I have been trying to install pygame for 3.3 and 3.4 and can't find a way to install it probably with out it giving a error when I do pygame.init().
Is it because pygame.init() is not the proper code or is it because I installed it incorrectly? If so, can someone tell me how to install it?
You can find binary installations for pygame for python 3.4 on windows here. I'm not sure where you could find it if you're running a different operating system.
Check out downloads on their bitbucket repo (for windows):
https://bitbucket.org/pygame/pygame/downloads
On Windows: open your comandline and type:
pip install pygame
On Debian-based Linux type into your terminal:
sudo apt-get install python-pygame
I would recommend Gohlke's precompiled pythonlibs in wheel format :) pygame from Gohlke
I was never let down by those libraries and I used numpy, scipy, scikit-learn etc. (and pygame as well) extensively, which are one of the tougher to build on windows ;)
I have been trying to install pygame for 3.3 and 3.4 and can't find a way to install it probably with out it giving a error when I do pygame.init().
Is it because pygame.init() is not the proper code or is it because I installed it incorrectly? If so, can someone tell me how to install it?
You can find binary installations for pygame for python 3.4 on windows here. I'm not sure where you could find it if you're running a different operating system.
Check out downloads on their bitbucket repo (for windows):
https://bitbucket.org/pygame/pygame/downloads
On Windows: open your comandline and type:
pip install pygame
On Debian-based Linux type into your terminal:
sudo apt-get install python-pygame
I would recommend Gohlke's precompiled pythonlibs in wheel format :) pygame from Gohlke
I was never let down by those libraries and I used numpy, scipy, scikit-learn etc. (and pygame as well) extensively, which are one of the tougher to build on windows ;)
I use Mac OS X Lion and Python 2.7. I am new to python. Can anyone tell me how to import AppKit and PyObjC to Python. But i get the errors when trying to import Import Error: No module named AppKit or 'Import Error: No module named PyObjC.
Trying easy_install does not help either.
What can i do to import these 2 modules?
If not already installed, install pip by running:
sudo easy_install pip
Then run:
## install for all users
sudo pip install pyobjc
or
## install for current user only
pip install pyobjc --user
NOTE: the general recommendation is to avoid using the system python, and use instead a user-maintained version, for example installed via brew install python3, macports, conda or whatever you already use for third party dependencies.
If you're on Mac it could be you're using the incorrect pip version, try sudo pip3 install -U pyobjc that solved it for me.
This a good guide on how to install PyObjc: http://ioanna.me/2009/09/installing-pyobjc-xcode-templates-in-snow-leopard/
When I was trying to install PyObjc I found it quite hard, but after a while, (and lots of google searches) I got it working.
Edit
I've found a more modern guide on how to do this. Download the templates and put them into your ~/Library/Developer/Xcode/Templates/ directory, and everything should work correctly.
If you are using PyCharm, you should install PyObjC package manually within it because of venv I guess. This was the only working solution for me.
In my case none of them worked. I was using Anaconda in my mac, later I discovered that the main issue with the Anaconda. Then I installed PyObjC with it's all supporting libraries inside Anaconda in a specific Environment.
I run the command line by clicking the Environment play icon and run my script.
It worked without any issues :)
I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6.
I typed idle3.2 in the terminal and it gave me:
IDLE can't import Tkinter. Your Python may not be configured for Tk.
So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, I rechecked that I have tclsh on the system, but I still can't manage to open idle3.2.
Any input would be appreciated.
On OSX, this can be resolved with macports by installing the python tkinter package for your python version. In my case, with python 2.7, I ran on the terminal:
sudo port install py27-tkinter
change the "27" to your python version number.
On Ubuntu:
sudo apt-get install idle
Choose one from
idle
idle3
idle-python2.6
idle-python2.7
idle-python3.1
idle-python3.2
for your python version.
The problem is caused by the version between python and idle not matching.
U can check your python version by typing : python
Then sudo aptget install the right idle version same with your python version
I ran into the same error message when installing python3.4 on Fedora 20. The problem was that tk-devel was not installed during the python configure/make. The explicit steps to do this correctly are
download and extract python3.4 from python.org https://www.python.org/downloads/
Find and install the right tkinter and tk-devel:
yum search tkinter
yum install python3-tkinter-3.3.2-17.fc20.x86_64
yum search tk-devel
yum install tk-devel.x86_64
AFTER these are onboard, cd into the python3.4 package directory and run the configure; make, make install process.
I spent too much time resolving this issue. Hopefully this post will help may others to a quick resolution.
PS stackoverflow is awesome. If google brought you to this article, spend some time and surf around the site.
If you installed python-tk and the system is running python 2.6 then it is most likely that you installed Tkinter for python 2.6. Try installing python3-tk.
you need to install tk or tk-dev packages for ubuntu.
On my arch linux system I had the same problem easily solved by typing
yaourt tkinter
and installing the first package community/python-pmw 2.0.1-2 [installed]
Type "idle-python2.6" in the terminal..it worked for me