Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while upgrading pip #2686

Closed
jayachar88 opened this issue Apr 15, 2015 · 12 comments
Closed

Exception while upgrading pip #2686

jayachar88 opened this issue Apr 15, 2015 · 12 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@jayachar88
Copy link

Currently using Lubuntu 14.11 and python2. By default pip 1.5.6-2 is supposed to be installed.
However, I've installed PyCharm 4.0.6 and installed modules via it. It offered me to upgrade package to pip 6.1.1, which I did. However, I think it broke something, but not quite sure (I am new to python).

I attempted to reinstall python-pip 1.5.6-2 via package manager, which seemed to go through fine, but I still have the exceptions. Again, trying to upgrade by doing "pip install -U pip", I get this:

jayachar88@kailash:~$ pip install -U pip
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-6.1.1-py2.py3-none-any.whl#md5=172eb5abab25a5e0f7a7b63c7a49378d
Downloading pip-6.1.1-py2.py3-none-any.whl (1.1MB): 1.1MB downloaded
Installing collected packages: pip
Found existing installation: pip 1.5.6
Uninstalling pip:
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 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1431, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 598, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1836, in remove
renames(path, new_path)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 295, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/bin/pip'

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


Pastebin for pip.log: http://pastebin.com/PF16JyBC

@jayachar88
Copy link
Author

After reading around quite a bit on several similar / somewhat related bug reports, the following 2 steps solved it for me (or seem to have solved it for now):

$ sudo python -m pip install --upgrade --force setuptools
$ sudo python -m pip install --upgrade --force pip

@ghost
Copy link

ghost commented Apr 15, 2015

<3

@rbtcollins
Copy link

I'm not sure this is a bug - possibly a docs issue? Changing global state on your machine requires sudo...

@dstufft
Copy link
Member

dstufft commented May 9, 2015

Yea, this isn't a bug, you need to use sudo to change your global Python installation.

@dstufft dstufft closed this as completed May 9, 2015
@danyaljj
Copy link

danyaljj commented Mar 2, 2017

Solved my problem! :)

@braselectron
Copy link

Dear @jayachar88 ,

Not only did you solve this bug, but also a greater bug of Ubuntu community, which is the software-center crash bug.

The blogs on the web are full of 'false solution' to software-center bug affecting ubuntu users.

I diagnosed the problem as a pip bug or pip configuration corruption.

so, using the:

$ sudo python -m pip install --upgrade --force setuptools
$ sudo python -m pip install --upgrade --force pip

solved both the problems. THANK YOU!!!

@aashish-ak
Copy link

Getting following error, whenever trying to install anything using pip also i'm using proxy:

ts/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/c
achecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/reques
ts/adapters.py", line 376, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib
3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib
3/util/retry.py", line 228, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'

@RonnyPfannschmidt
Copy link
Contributor

@aashish-ak thats a issue with your distro, which has split out pip in a way thats known to break interestingly

@dildilmurod
Copy link

same problem in windows. How can I solve it?

@AymaneZizi
Copy link

@dildilmurod
$ sudo python -m pip install --upgrade --force setuptools
$ sudo python -m pip install --upgrade --force pip
and if wont fix then
$ sudo apt-get install python3-pip
then use the pip3 instead of pip.
best of luck!

@benoit-pierre
Copy link
Member

@AymaneZizi: he's using Windows...

@lock
Copy link

lock bot commented Jun 1, 2019

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.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

10 participants