pip fails to install some Python packages...

Created on 18 Sep 2017  ·  3Comments  ·  Source: pypa/pip

  • Pip version: 9.0.1
  • Python version: 3.5.2
  • Operating system: Ubuntu 16.04

Description:

// REPLACE ME: What are you trying to get done, what has happened, what went wrong, and what did you expect?
NO ERROR

What I've run:

```$ pip install matplotlib
Collecting matplotlib
Using cached matplotlib-2.0.2-cp35-cp35m-manylinux1_x86_64.whl
Requirement already satisfied: numpy>=1.7.1 in /home/jiapei/.local/lib/python3.5/site-packages (from matplotlib)
Requirement already satisfied: pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /usr/lib/python3/dist-packages (from matplotlib)
Requirement already satisfied: pytz in /usr/lib/python3/dist-packages (from matplotlib)
Requirement already satisfied: six>=1.10 in /home/jiapei/.local/lib/python3.5/site-packages (from matplotlib)
Collecting cycler>=0.10 (from matplotlib)
Using cached cycler-0.10.0-py2.py3-none-any.whl
Requirement already satisfied: python-dateutil in /usr/lib/python3/dist-packages (from matplotlib)
Installing collected packages: cycler, matplotlib
Found existing installation: cycler 0.9.0
Uninstalling cycler-0.9.0:
Exception:
Traceback (most recent call last):
File "/usr/lib/python3.5/shutil.py", line 538, in move
os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/__pycache__/cycler.cpython-35.pyc' -> '/tmp/pip-6xxm78w3-uninstall/usr/lib/python3/dist-packages/__pycache__/cycler.cpython-35.pyc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/jiapei/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/jiapei/.local/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/jiapei/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "/home/jiapei/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/home/jiapei/.local/lib/python3.5/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/home/jiapei/.local/lib/python3.5/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python3.5/shutil.py", line 553, in move
os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/__pycache__/cycler.cpython-35.pyc'```

auto-locked support

Most helpful comment

From the line

PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/__pycache__/cycler.cpython-35.pyc' -> '/tmp/pip-6xxm78w3-uninstall/usr/lib/python3/dist-packages/__pycache__/cycler.cpython-35.pyc'

it looks like you're trying to manage a system-installed package using a user-level pip command. You should be using your system package manager (apt) to manage the system installed packages, or if you are trying to use packages not provided by your system, you should use a user-level installation, either via pip install --user or by using virtual environments to create an independent Python environment that you can use without affecting your system installed environment.

All 3 comments

From the line

PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/__pycache__/cycler.cpython-35.pyc' -> '/tmp/pip-6xxm78w3-uninstall/usr/lib/python3/dist-packages/__pycache__/cycler.cpython-35.pyc'

it looks like you're trying to manage a system-installed package using a user-level pip command. You should be using your system package manager (apt) to manage the system installed packages, or if you are trying to use packages not provided by your system, you should use a user-level installation, either via pip install --user or by using virtual environments to create an independent Python environment that you can use without affecting your system installed environment.

Closing due to a lack of a response.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings