EasilyBaffled
EasilyBaffled

Reputation: 3882

download Python 3.3 modules

I am running python 3.3 on my Mac with mountain lion. I am trying to download the twitter api. Most sources say use pip, which requires easy_install, which apparently I do not have. When in the terminal I run new-host-2:~ lego90511$ easy_install pipand in response I get error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the installation directory:

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-25628.write-test'

The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/Library/Python/2.7/site-packages/

Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable.

For information on other options, you may wish to consult the documentation at:

http://peak.telecommunity.com/EasyInstall.html

Please make the appropriate changes for your system and try again.

Does anyone know what I am doing wrong?

Upvotes: 0

Views: 1687

Answers (2)

mmmmmm
mmmmmm

Reputation: 32671

You have two issues here. One is the permissions issue as mentioned by @garnertb. pip tries to install in the site packages of the Python install which is owned by root.

The other issue is that you are installing into Apple's python 2.7 and you say you want python 3.3. enter link description hereThe reason for this is that easy_install includes n its text the directory of the python that it comes from. Just typing easy_install gets you the first on the path which in this case looks like /usr/bin/easy_install which is the Apple installed one. you get the easy_install for python 3.3 you have to give its full path which depends on how you installed python 3.3

The pip install page says

Warning We advise against using easy_install to install pip

Its suggested methods are to install virtualenv as per this unfortunately even though both written by the same group they seem to each say start with the other. In virtualenv take the source code route, which is the third and fourth entries there after the pip examples.

The global install is

$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
$ tar xvfz virtualenv-X.X.tar.gz
$ cd virtualenv-X.X
$ [sudo] python setup.py install

On OSX I installed python and thus pip via Macports so as to get easy installation of libraries that require complex C builds and also make this bootstrapping easier as this has been done for you.

Upvotes: 1

garnertb
garnertb

Reputation: 9584

As mentioned in your question, this could be a permissions issue. Try installing using sudo:

sudo easy_install pip

Upvotes: 0

Related Questions