[Tutor] attempting to install PIP

Albert-Jan Roskam fomcl at yahoo.com
Mon Nov 24 13:10:21 CET 2014


> From: Paul LaBerge <labergepaul at icloud.com>
>To: tutor at python.org 
>Sent: Monday, November 24, 2014 6:05 AM
>Subject: [Tutor] attempting to install PIP
> 
>
>
>Hello,
>I’m trying to install PIP on a Mac running Yosemite. I downloaded get-pip.py from https://pip.pypa.io/en/latest/installing.html. I copied it to /usr/local/bin/ then  ran python get-pip.py. It repeatedly downloaded something up to a count of 100. From looking at the debug log it seems it was checking every version of PIP back to 0.2 before selecting version 1.5.6. 
>Using version 1.5.6 (newest of versions: 1.5.6, 1.5.6, 0.2)
>
>
>The result was:
>snip
>99  Downloading pip-1.5.6-py2.py3-none-any.whl (1.0MB): 100  Downloading pip-1.5.6-py2.py3-none-any.whl (1.0MB):      Downloading pip-1.5.6-py2.py3-none-any.whl (1.0MB): 1.0MB downloaded
>Installing collected packages: pip
>Cleaning up...
>Exception:
>Traceback (most recent call last):
>  File "/var/folders/ft/pthcg_6j06zfdp0sl14kn76w0000gn/T/tmp6QIoTv/pip.zip/pip/basecommand.py", line 122, in main
>    status = self.run(options, args)
>  File "/var/folders/ft/pthcg_6j06zfdp0sl14kn76w0000gn/T/tmp6QIoTv/pip.zip/pip/commands/install.py", line 283, in run
>    requirement_set.install(install_options, global_options, root=options.root_path)
>  File "/var/folders/ft/pthcg_6j06zfdp0sl14kn76w0000gn/T/tmp6QIoTv/pip.zip/pip/req.py", line 1435, in install
>    requirement.install(install_options, global_options, *args, **kwargs)
>  File "/var/folders/ft/pthcg_6j06zfdp0sl14kn76w0000gn/T/tmp6QIoTv/pip.zip/pip/req.py", line 671, in install
>    self.move_wheel_files(self.source_dir, root=root)
>  File "/var/folders/ft/pthcg_6j06zfdp0sl14kn76w0000gn/T/tmp6QIoTv/pip.zip/pip/req.py", line 901, in move_wheel_files
>    pycompile=self.pycompile,
>  File "/var/folders/ft/pthcg_6j06zfdp0sl14kn76w0000gn/T/tmp6QIoTv/pip.zip/pip/wheel.py", line 215, in move_wheel_files
>    clobber(source, lib_dir, True)
>  File "/var/folders/ft/pthcg_6j06zfdp0sl14kn76w0000gn/T/tmp6QIoTv/pip.zip/pip/wheel.py", line 205, in clobber
>    os.makedirs(destdir)
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
>    mkdir(name, mode)
>OSError: [Errno 13] Permission denied: '/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip'
>
>
>Storing debug log for failure in /Users/PaulSan/.pip/pip.log

You should run the command as root. Also, get-pip.py does not have to be in opt, it could be anywhere, eg.
sudo python ~/Downloads/get-pip.py

Another option is to download the .tar.gz pip from Pypi, untar it, cd to it, then 
sudo python setup.py install
 
If you don't have sufficient rights you might be able to do:
python setup.py --user

I believe 'sudo' is a Debian-specific thing.

regards,
Albert-Jan


More information about the Tutor mailing list