Easy_install the wrong version of python modules (Mac OS)

5

4

I installed Python 2.7 on my Mac. When typing "python" in terminal, it shows:

$ python
Python 2.7 (r27:82508, Jul  3 2010, 20:17:05) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

The Python version is correct here.

But when I try to easy_install some modules. The system will install the modules with python version 2.6 which are not able be imported to Python 2.7. And of course I can not do the functions I need in my code. Here's an example of easy_install graphy:

$ easy_install graphy
Searching for graphy
Reading pypi.python.org/simple/graphy/
Reading http://code.Google.com/p/graphy/
Best match: Graphy 1.0.0
Downloading http://pypi.python.org/packages/source/G/Graphy/Graphy- 1.0.0.tar.gz#md5=390b4f9194d81d0590abac90c8b717e0
Processing Graphy-1.0.0.tar.gz
Running Graphy-1.0.0/setup.py -q bdist_egg --dist-dir /var/folders/fH/fHwdy4WtHZOBytkg1nOv9E+++TI/-Tmp-/easy_install-cFL53r/Graphy-1.0.0/egg-dist-tmp-YtDCZU
warning: no files found matching '*.tmpl' under directory 'graphy'
warning: no files found matching '*.txt' under directory 'graphy'
warning: no files found matching '*.h' under directory 'graphy'
warning: no previously-included files matching '*.pyc' found under directory '.'
warning: no previously-included files matching '*~' found under directory '.'
warning: no previously-included files matching '*.aux' found under directory '.'
zip_safe flag not set; analyzing archive contents...
graphy.all_tests: module references __file__
Adding Graphy 1.0.0 to easy-install.pth file

Installed /Library/Python/2.6/site-packages/Graphy-1.0.0-py2.6.egg
Processing dependencies for graphy

Finished processing dependencies for graphy

So it installs graphy for Python 2.6.

Can someone help me with it? I just want to set my default easy_install Python version to 2.7.

user73250

Posted 2011-03-12T16:10:47.400

Reputation: 63

1What happens when you type which python and which easy_install? How did you install Python 2.7, how did you install easy_install? – Daniel Beck – 2011-03-12T16:20:04.960

Ma-Xiaolongs-MacBook-Pro-2:~ MaXiaolong$ which python /Library/Frameworks/Python.framework/Versions/2.7/bin/python Ma-Xiaolongs-MacBook-Pro-2:~ MaXiaolong$ which easy_install /usr/bin/easy_install – user73250 – 2011-03-13T03:55:07.443

I just download the python 2.7 and install the python. But I have no idea how I installed easy_install.. I thought it comes with python.. I'm new to python, sorry about that. Can you help me to think about how to fix the problem? Really appreciate it. – user73250 – 2011-03-13T03:57:26.007

Answers

6

It seems that your installation of setuptools is obsolete.

If you want your "easy_install" match your updated python version, follow these steps:

This will install the new "easy_install" executable, compatible with your current version of python.

Hope this helps.

(more details at http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other)

fjavieralba

Posted 2011-03-12T16:10:47.400

Reputation: 76

lols~~~~it works!!!!!really thanks!!!!!!!!!!!!!!!!!!!!!!!I successfully did this several days ago and I also make easy_install works properly, but i tried hundreds of methods, i forgot which one make easy_install works properly T.T Unfortunately i reinstalled my mac just now = =! I was afraid of that I need to try hundreds times again. Luckily that I saw your answer now!!! thank you very much : ) – user73250 – 2011-03-24T15:28:15.617

0

Not sure if this is what you are looking for, but if you command+i a python file you can change which version you want the file to be opened with.

varmemester

Posted 2011-03-12T16:10:47.400

Reputation: 126

really thank you for your answer. But this doesn't solve my problem. My problem is not run the code with a wrong version. It's easy_install in the wrong version of python. Anyway, thank you all the same : ) – user73250 – 2011-03-13T15:18:34.203

0

The solution by fjavieralba did not work for me. What did work was installing easy_install using the tarball.

  1. Download tarball from http://pypi.python.org/pypi/setuptools#files (I placed it in /tmp/)
  2. Extract it using the command tar -zxvf setuptools-0.6c11.tar.gz
  3. cd /setuptools-0.6c11
  4. install it with the python I want easy_install to work with (2.7, which in my case was under /usr/local/bin/python.

This was with:

/usr/local/bin/python setup.py build
/usr/local/bin/python setup.py install

And finally I can use east_install to get the package I want. For python2.7:

easy_install-2.7 *NAME*

or, for python 2.6:

easy_install-2.6 *NAME*

Dana

Posted 2011-03-12T16:10:47.400

Reputation: 139