Peetu Oksanen
Peetu Oksanen

Reputation: 3

I can't upgrade pip on my raspberry pi

I want to install simpleaudio but can't upgrade or install anything with pip, here's what it gives me:

Downloading/unpacking pip from             https://pypi.python.org/packages/9c/32/004ce0852e0a127f07f358b715015763273799b    d798956fa930814b60f39/pip-8.1.2-py2.py3-none-any.whl#md5=0570520434c5b600d89ec95393b2650b
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.6
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
  Can't roll back pip; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 214, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 204, in clobber
    os.makedirs(destdir)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pip-8.1.2.dist-info'

Storing debug log for failure in /home/pi/.pip/pip.log

I'm using Rasbian with NOOBS if that help figuring this out. I've just started studying programming so I have no clue what I need to do since using the guides results to above, so please explain this to an idiot.

Upvotes: 0

Views: 3028

Answers (1)

ForceBru
ForceBru

Reputation: 44830

pip fails to access some system paths and shows clearly that the user used to run pip does not have enough privileges to access them.

To solve this, try to run these commands as root using sudo:

sudo pip <options>

Otherwise, if you don't have sudo installed (this is almost impossible) or if you're just curious and know the root's password, simply log in as root and execute your commands without sudo:

su # or su root
# type the root's password

pip <options>

If you use this option, don't forget to log out after you've installed everything!

Upvotes: 1

Related Questions