2

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?

3 Answers 3

1

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)

1

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

1
  • 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, 2011 at 12:34
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .