pip install --upgrade without permissions deletes old pip before failing
See original GitHub issue- Pip version: 8.1-1
- Python version: 2.7.11
- Operating System: 10.9.5
Description:
Running pip install --upgrade pip, without proper permissions, results in:
- Old pip getting uninstalled
- New pip failing to install due to permissions issues when writing files
Now the system lacks pip entirely.
What I’ve run:
I have pip installed with homebrew, but forgot about this. I ran:
pip install --upgrade pip
Got back:
Collecting pip
Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 270kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 746, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/pip-8.1.1.dist-info/DESCRIPTION.rst'
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Then I ran:
sudo pip install --upgrade pip
And got back:
sudo: pip: command not found
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15 (5 by maintainers)
Top Results From Across the Web
pip install access denied on Windows - python - Stack Overflow
Change your Python installation folder's security permissions by: Open a Python shell; Go to task manager; Find ...
Read more >Pip upgrade to 22.3 windows10 - Packaging
Hi all, I'm trying to upgrade my pip version. I'm running in cmd promtp as admin and my error is this When I...
Read more >User Guide - pip documentation v22.3.1
There are 2 upgrade strategies supported: eager : upgrades all dependencies regardless of whether they still satisfy the new parent requirements.
Read more >PyPI packages in the Package Registry - GitLab Docs
Before you can publish to the Package Registry, you must authenticate. ... image: python:latest run: script: - pip install build twine - python...
Read more >Configure and use pip with CodeArtifact - AWS Documentation
To use pip to install Python packages from your CodeArtifact repository, you must first configure the pip client with your CodeArtifact repository ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You don’t have rw permission to the directories. Assuming you have administrator rights, you can change the permissions with
sudo chown -R $USER /absolute/path/to/directory
. If you’re running OS X 10.11+, you’ll probably also need disable the System Integrity Protection, but don’t forget to reenable it after you’re done (just to be safe).@tallakahath
sudo chown -R $USER /usr/local/lib/python2.7/
@JikkuJosesudo chown -R $USER /Library/Python/2.7/
Yeah, seriously! I’m having the exact same problem. It’s ridiculous! Does anyone have a fix??