Installing pygame with enthought canopy on Mac - python

I'm trying to install pygame in my enthought canopy python distribution. I'm using the latest version of canopy for 64-bit Mac (Python 2.7.6), and I'm using Mavericks OS. I know that installing pygame should be possible since I managed to get pygame working with the official python 2.7.6 from the python website using the binary installation file available here.
The first thing I tried was ensuring that canopy was my default python, and the installation file linked above, but this just re-installed pygame into the official python distribution.
Next I tried pip, which I've used to install other packages successfully (e.g., spyder). The following is what happens when I try pip install pygame:
Downloading/unpacking pygame
Downloading pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip (7.4Mb): 7.4Mb
downloaded
Running setup.py egg_info for package pygame
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/Users/Sam/build/pygame/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory:
'/Users/Sam/build/pygame/setup.py'
This is different to the error reported here, so I'm not sure at all what's going on. Any suggestions?

On Yosemite and Canopy 64bit assuming you have homebrew, pygame installed fine with:
brew install sdl sdl_ttf sdl_image sdl_mixer
brew install hg
sudo pip install hg+http://bitbucket.org/pygame/pygame

I think I found a solution: I simply used pip to install pygame from a specific location, using sudo pip install hg+http://bitbucket.org/pygame/pygame. Unlcear why this worked, however.

You need to install a 32 bit version of Python. PyGame doesn't run on the 64 bit builds, and OSX ships with a 64 bit build.
download from here python2.7.3
then download pygames

Related

Python openglcontext install fails on MacOS 11.6 [duplicate]

I've recently decided to learn OpenGl in python.
I installed PyOpenGL using pip3 install PyOpenGl PyOpenGl_accelerate. I was then about to follow a
tutorial for PyOpenGL. The first item was to install PyOpenGLContext.
I tried to install PyOpenGLContext with both pip3 install OpenGLContext and pip3 install PyDispatcher PyVRML97 OpenGLContext and both gave me the same error:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/3r/xfny397j6j98y1sjgh_s574m0000gn/T/pip-build-o7zx54vx/OpenGLContext/setup.py", line 10
except ImportError, err:
^
SyntaxError: invalid syntax
So, there's a syntax error there. How do I get around this? If you need more information, please let me know. I am trying to install this on a MacBook Pro (2013) version for Python3.5.
It should work if you download and install the wheel from Unofficial Windows Binaries for Python Extension Packages:
Download the OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl installation file to a an arbitrary directory.
cd to that directory in a command line and install using pip install OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl
It looks like OpenGLContext has not been updated in a while, and thus is not compatible with Python 3.5.
Having a look at https://pypi.python.org/pypi/OpenGLContext yields that the last update was in 2014.
You probably want to either use an older python version, or a different library.

PyAudio (PortAudio issue) Python

I installed pyaudio with anaconda python. Using conda install pyaudio on windows.
It said it installed and it also installed PortAudio with it.
However, when I create my file and run it now I get the following issue.
I have no idea what is going on.
Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
File "C:\Users\This PC\Desktop\Py\demo.py", line 2, in <module>
import pyaudio
File "C:\Users\This PC\Anaconda3\lib\site-packages\pyaudio.py", line 116, in <module>
import _portaudio as pa
ImportError: DLL load failed: The specified module could not be found.
I ran into this error with win32 py3 using Anaconda3. Re-installing portaudio fixed this:
conda install portaudio
It just updated the package for me, and pyaudio was able to find the DLL then.
I faced a similar issue.
The only way I was able to resolve this was by uninstalling anaconda, installing the latest version of python, and reinstalling the latest version of conda.
I then downloaded the latest .whl file for pyaudio which can be found here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
I moved this file from my downloads and into the site-packages folder of anaconda3:
C:\Users\Projects\Anaconda3\Lib\site-packages
Upon running the command 'pip install pyaudio' OR 'python -m pip install pyaudio' in the anaconda prompt I was good to go
I hope this helps!

sudo install - Python 3?

I'm new to Linux and I'm trying to install packages through a Makefile so users can run my Python 3 program.
sudo pip install python3-weather-api
However, even after uninstalling a previously installed version, the package seems to be going to the 2.7 version of Python.
Requirement already satisfied: python3-weather-api in /usr/local/lib/python2.7/dist-packages
Then, when I run the program, it can't find the module (it works locally in Python 3 just fine).
SystemExit: 1
Traceback (most recent call last):
File "project.py", line 11, in <module>
from weather import Weather
ImportError: No module named 'weather'
Is there a way I can point the original installation so when I run python3 project.py it can find the module?
Thanks very much!
I would recommend you to use pyenv to manage your Python installations, but, for now, try to run:
sudo pip3 install python3-weather-api

ImportError: cannot import name HTTPSHandler installing get-pip.py

I'm getting this error when I try to install pip2.7.
I have python 2.7 as my default already, but I'm not sure why I'm getting this.
OS: CentOS 6.5
OpenSSL has been installed already.
I followed this guide to install Python 2.7:
http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/
[root#myservername arandomfolder]# python get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 17474, in <module>
main()
File "get-pip.py", line 17466, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 17406, in bootstrap
import pip
File "/tmp/tmpXq2wUP/pip.zip/pip/__init__.py", line 10, in <module>
File "/tmp/tmpXq2wUP/pip.zip/pip/util.py", line 18, in <module>
File "/tmp/tmpXq2wUP/pip.zip/pip/_vendor/distlib/version.py", line 14, in <module>
File "/tmp/tmpXq2wUP/pip.zip/pip/_vendor/distlib/compat.py", line 31, in <module>
ImportError: cannot import name HTTPSHandler
You have a Python without SSL support compiled. Unfortunately, get-pip appears to require SSL support.
If you are using a Linux distribution, make sure OpenSSL is installed, including the headers when compiling Python from source.
So looks like i was missing the openssl-devel dependency
after I had installed that, i was able to install this.
I was having this issue on a Centos 6.5 machine even though I had openssl and openssl-devel installed. I was also using the steps from the site:
http://toomuchdata.com/2014/02/16/how-to-install-python-on-centos/
I removed python packages I had installed before: virtualenv, NetworkX, and pil:
pip uninstall virtualenv
pip uninstall NetworkX
pip uninstall pil
Then I compiled Python 2.7 again and no longer had this issue. After I followed the steps in the link below, I reinstalled the above packages using pip2.7:
pip2.7 install virtualenv
pip2.7 install NetworkX
pip2.7 install pil --allow-external pil --allow-unverified pil
I have meet the same problem. I solved it by install openssl-devel and reconfigure, make, make install python3:
yum install openssl-devel
then go to the python3 directory:
./configure --with-zlib --with-openssl
make
make install

Django Taggit Module Installation Error: No module named setup tools

The title basically explains it all.
I am running Windows 8 (windows 7 was previously installed... If it helps with answering) and am using Python 2.7.
Upon using the code:
python setup.py install
I am getting this error:
C:\Users\Nicholas\Desktop\taggit>python setup.py install
Traceback (most recent call last):
File "setup.py", line 52, in
from setuptools import setup
ImportError: No module named setuptools
Any help?
Thanks in advance
Nicholas
You need to install setuptools, which allows packages to be configured for your Python installation. It is not included with the default Python installer.
From this link you can download Windows installers for many Python packages (I have linked it directly to setuptools). Make sure you download the version that matches your Python installation.
in Python 3:
pip3 install setuptools
And in Python 2.x:
pip install setuptools

Categories