[Tutor] Auto-detecting of Python version - wrong!

Steven D'Aprano steve at pearwood.info
Mon Aug 29 14:54:05 CEST 2011

Elisha Rosensweig wrote:

> I'm trying to use easy_install on my Mac to get the Python networx package.
> On my machine I have installed version 2.5 AND 2.6 of Python. However, wehn
> I try to install this package, I get:

Hi Elisha,

This list is for beginners trying to learning Python the language, not 
trying to solve arbitrary Python-related problems. You are more likely 
to get an answer by asking on one of the larger/busier lists, like 
python-list at python.org (also available on Usenet under 
comp.lang.python). You are more likely to find somebody who uses 
easy_install and a Mac there.

But in the meantime, my *wild guess* is that this is a file association 
problem. If you call the python app directly with "python", the most 
recently added version (version 2.6) gets called, but if you try to run 
the easy_install directly script, the Mac automatically associates it 
with Python 2.5 and installation fails.

Can you show us exactly how you are calling the easy install script?

Another possibility is that it is an issue with the PATH. If you are 
calling "python" from the command line as a regular user, it might be 
picking up one version of Python, but if you call it as root 
(superuser), you might get a different PATH and therefore a different 
version of Python. Again, this depends on how you are calling the easy 
install script.

(I emphasis that these are guesses... I haven't used Apple Macs 
regularly since System 7, back when Steve Jobs was still persona non 
grata at Apple. How times have changed.)


More information about the Tutor mailing list