Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've installed python 2.7 with the dmg-installer of the official python page. After typing which python in terminal, I get this:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python

But when I want to install a package with easy_install, for example like this easy_install pycassa, I get the message Installed /Library/Python/2.6/site-packages/pycassa-1.1.0-py2.6.egg, what is obviously the wrong path. So when I try to use the installed package with import pycassa I get the error "no module named pycassa".

So how can I fix this issue best?

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

It seems that your installation of setuptools is obsolete.

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

Download the corresponding .egg file at http://pypi.python.org/pypi/setuptools#files Run it as if it were a shell script: sh setuptools-0.6c9-py2.7.egg 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)

share|improve this answer
add comment

Find out where easy_install is by in terminal

which easy_install

I suspect that it will be /usr/bin which is Apple's python 2.6

EDIT: I don't have the python.org python so this is from memory.

To use easy_install for the python.org 2.7 use /usr/local/bin/easy_install or /Library/Frameworks/Python.framework/Versions/2.7/bin/easy_install

Also easy_install is not in the Python standard library so you would have to install a package either setuptools or distribute I think the latter is now the preferred one.

To check what easy_install does look at the first line and see what python is used in the #! line

share|improve this answer
    
Thank you for your answer, you're rhight, easy_install is where you suggested. The path you provided does not exist: sudo: /usr/local/bin/easy_install: command not found –  strauberry Jun 13 '11 at 12:34
add comment

After installing a new version of the setup tools you may find that you have multiple copies of easy_install installed.

Try: 'which easy_install'

If its not the right version, you'll probably find you have other links 'easy_install<tab>' should show something like:

PER-MMSX:actions doug$ easy_install
easy_install      easy_install-2.5  easy_install-2.6  easy_install-2.7  

Use 'sudo easy_install-2.7 ' to ensure that you're using exactly the right version.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.