Exception while upgrading pip #2686

Closed
jayachar88 opened this Issue Apr 15, 2015 · 9 comments

Comments

Projects
None yet
8 participants
@jayachar88

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

This comment has been minimized.

Show comment
Hide comment
@jayachar88

jayachar88 Apr 15, 2015

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

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

This comment has been minimized.

Show comment
Hide comment

ghost commented Apr 15, 2015

<3

@rbtcollins

This comment has been minimized.

Show comment
Hide comment
@rbtcollins

rbtcollins Apr 17, 2015

Contributor

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

Contributor

rbtcollins commented Apr 17, 2015

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

@dstufft

This comment has been minimized.

Show comment
Hide comment
@dstufft

dstufft May 9, 2015

Member

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

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 May 9, 2015

@danyaljj

This comment has been minimized.

Show comment
Hide comment
@danyaljj

danyaljj Mar 2, 2017

Solved my problem! :)

danyaljj commented Mar 2, 2017

Solved my problem! :)

@braselectron

This comment has been minimized.

Show comment
Hide comment
@braselectron

braselectron Mar 30, 2017

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!!!

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

This comment has been minimized.

Show comment
Hide comment
@aashish-ak

aashish-ak Dec 5, 2017

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'

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

This comment has been minimized.

Show comment
Hide comment
@RonnyPfannschmidt

RonnyPfannschmidt Dec 5, 2017

Contributor

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

Contributor

RonnyPfannschmidt commented Dec 5, 2017

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

@dildilmurod

This comment has been minimized.

Show comment
Hide comment
@dildilmurod

dildilmurod May 30, 2018

same problem in windows. How can I solve it?

same problem in windows. How can I solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment