Anyone able to help on installing packages?

Oscar Benjamin oscar.j.benjamin at gmail.com
Sun Sep 23 16:51:45 EDT 2012


Please send your reply to the mailing list (python-list at python.org) rather
than privately to me.

On 23 September 2012 20:57, John Dildy <jdildy85 at gmail.com> wrote:

> When I give input at the start of terminal using the command pip install
>  virtualenv:
>
> Downloading/unpacking virtualenv
>   Running setup.py egg_info for package virtualenv
>
>     warning: no previously-included files matching '*' found under
> directory 'docs/_templates'
>     warning: no previously-included files matching '*' found under
> directory 'docs/_build'
> Installing collected packages: virtualenv
>   Running setup.py install for virtualenv
>     error: /Library/Python/2.7/site-packages/virtualenv.py: Permission
> denied
>     Complete output from command /usr/bin/python -c "import
> setuptools;__file__='/var/folders/4r/jxvj6v_j5571vbjxkx_jbdy80000gp/T/pip-build/virtualenv/setup.py';exec(compile(open(__file__).read().replace('\r\n',
> '\n'), __file__, 'exec'))" install --record
> /var/folders/4r/jxvj6v_j5571vbjxkx_jbdy80000gp/T/pip-S9mDRc-record/install-record.txt
> --single-version-externally-managed:
>     running install
>
> running build
>
> running build_py
>
> running install_lib
>
> copying build/lib/virtualenv.py -> /Library/Python/2.7/site-packages
>
> error: /Library/Python/2.7/site-packages/virtualenv.py: Permission denied
>

Your user account does not have permission to install the package in the
place where you want to install it.


>
> ----------------------------------------
> Command /usr/bin/python -c "import
> setuptools;__file__='/var/folders/4r/jxvj6v_j5571vbjxkx_jbdy80000gp/T/pip-build/virtualenv/setup.py';exec(compile(open(__file__).read().replace('\r\n',
> '\n'), __file__, 'exec'))" install --record
> /var/folders/4r/jxvj6v_j5571vbjxkx_jbdy80000gp/T/pip-S9mDRc-record/install-record.txt
> --single-version-externally-managed failed with error code 1 in
> /var/folders/4r/jxvj6v_j5571vbjxkx_jbdy80000gp/T/pip-build/virtualenv
> Storing complete log in /Users/jd3/Library/Logs/pip.log
>
> When I give the input of easy_install virtualenv:
>
> 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-6258.write-test'
>

This problem is exactly the same. It doesn't matter whether you use pip or
easy_install, you need to be an administrator to install the package in
that location.  See the rest of the message:


> 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.
>

There are two ways around this:

1) Run those commands as root. I don't use OSX but I believe the command is:
$ sudo pip install virtualenv

2)  Install into your user directory. I don't know if there's anything that
needs to be done to make this work on OSX but I can do this with:
$ sudo pip install --user virtualenv

Oscar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120923/7d4b2008/attachment.html>


More information about the Python-list mailing list