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

Error to upgrade pip from 9.0.3 to 10 #5343

Closed
cjadeveloper opened this issue Apr 28, 2018 · 20 comments
Closed

Error to upgrade pip from 9.0.3 to 10 #5343

cjadeveloper opened this issue Apr 28, 2018 · 20 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@cjadeveloper
Copy link

  • Pip version: 9.0.3
  • Python version: 3.6.4
  • Operating system: Windows 7

When I want to update pip with the command python -m pip install --upgrade pip aborts and I get the following error:

C:\Users\Cristian>python -m pip install -U pip
Collecting pip
  Using cached https://files.pythonhosted.org/packages/0f/74/ecd13431bcc456ed390
b44c8a6e917c1820365cbebcb6a8974d1cd045ab4/pip-10.0.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.3
    Uninstalling pip-9.0.3:
      Successfully uninstalled pip-9.0.3
  Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\base
command.py", line 215, in main
    status = self.run(options, args)
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\comm
ands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\req\
req_set.py", line 784, in install
    **kwargs
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\req\
req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\req\
req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\whee
l.py", line 462, in move_wheel_files
    generated.extend(maker.make(spec))
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\_ven
dor\distlib\scripts.py", line 372, in make
    self._make_script(entry, filenames, options=options)
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\_ven
dor\distlib\scripts.py", line 276, in _make_script
    self._write_script(scriptnames, shebang, script, filenames, ext)
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\_ven
dor\distlib\scripts.py", line 212, in _write_script
    launcher = self._get_launcher('t')
  File "C:\Users\Cristian\AppData\Roaming\Python\Python36\site-packages\pip\_ven
dor\distlib\scripts.py", line 351, in _get_launcher
    result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.
@iamrezashah
Copy link

i have rather same problem
I used Anaconda Prompt and wrote 'conda update pip' command after cloning it had been solved.
16

@pradyunsg
Copy link
Member

@cjadeveloper I suggest you install it using get-pip.py:

https://pip.pypa.io/en/stable/installing/

@pradyunsg
Copy link
Member

Okay. So there's quite a few people who seem to be facing this issue.

It would be nice if you could provide information about the environment for us to reproduce this and try to fix it.

@pradyunsg pradyunsg added S: needs triage Issues/PRs that need to be triaged and removed type: support User Support labels May 7, 2018
@supermansaga
Copy link

Just performed "python -m pip uninstall pip" first, then "python -m pip install -U pip"

Requirement already up-to-date: pip in c:\user\clarkk\appdata\local\Programs\Python\Python36\lib\site-packages (10.0.1)

@metallhead01
Copy link

metallhead01 commented May 8, 2018

Just performed "python -m pip uninstall pip" first, then "python -m pip install -U pip"

So I have...
C:\GITHUB\stress_testing\venv\Scripts\python.exe: No module named pip

@cjadeveloper
Copy link
Author

I followed this link Error while upgrading to pip 7.1.10 on Windows 8.1 (python 2.7)

easy_install -U pip

Solved broken dependencies and it worked for me

@dyspop
Copy link
Contributor

dyspop commented May 8, 2018

I had this issue as well... it seems various combinations of PATH and environment mangling can do this. Strangely I was able to upgrade this way:

python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip

which upgraded my system pip from 9.x to 10.0.1. i'd love to be able to explain why that worked but ¯_(ツ)_/¯

@Bidofvic
Copy link

Bidofvic commented Jun 8, 2018

I also experienced the same issue. The below later worked for me:
#Windows 10: pip upgrade from 9.0.1 to 10.0.1
(base) C:\XXXXXXXX>conda update pip
(base) C:\XXXXXXXX>conda update -n base conda
(base) C:\XXXXXXXX>conda create -n my_root --clone="C:\ProgramData\Anaconda3"
(base) C:\XXXXXXXX>conda activate my_root

#Tensorflow installation
(my_root) C:\XXXXXXXX>
(my_root) C:\XXXXXXXX>pip install tensorflow
(my_root) C:\XXXXXXXX>python -m pip install --upgrade pip

@kwanern
Copy link

kwanern commented Jun 13, 2018

Try:
right click Anaconda Prompt (Run as Admin)
$ conda update pip

@HAILCODING
Copy link

I am also facing problem while upgrading pip. So, I have first uninstalled it using python -m pip uninstall pip and then reinstalled it using Anaconda prompt by conda install pip .
Now it works perfectly with the latest pip version being installed.

@sydanny
Copy link

sydanny commented Jun 19, 2018

Any solution that doesn't require sudo?

@pfmoore
Copy link
Member

pfmoore commented Jun 19, 2018

@sydanny What's sudo got to do with it? This is a Windows issue...

@harshita-kaushal
Copy link

harshita-kaushal commented Aug 1, 2018

You should consider upgrading via the 'pip install --upgrade pip' command. Thedirectory '/Users/hkaushal/Library/Caches/pip/http' or its parent directory is not owned by thecurrentuser and the cache has been disabled. Please check the permissions and owner of thatdirectory.` If executing pip with sudo, you may want sudo's -H flag.

Don't really know how to resolve this..? I tried running sudo -H pip install --upgrade pip

*I ended up figuring it out, thanks!

@randhir123456789
Copy link

randhir123456789 commented Aug 15, 2018

You should consider upgrading via the 'pip install --upgrade pip' command.

@Mr-Ramzan
Copy link

Easy solution that worked for me is, open cmd with admin permissions then repeat the upgrade command

@TilmanK
Copy link

TilmanK commented Sep 7, 2018

Just a short note on this. I get the same error when I try to upgrade pip within my pycharm console. When I do this from an elevated cmd shell in windows (admin rights) the upgrade is successful.

@sahoopri
Copy link

sahoopri commented Apr 3, 2019

I tried this in a Mac updating from 9.0.3 to 19.0.3 with python 2.7 , and it worked for me. It seems admin user accouts help
sudo python -m pip uninstall pip

sudo easy_install -U pip

@pradyunsg
Copy link
Member

Please don't use easy_install. It's really old, deprecated and does not generate the metadata needed for uninstalling a package.

@pradyunsg
Copy link
Member

For anyone facing issues here, can you please follow https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py? Instead of the curl command, you can also download the linked file locally instead.

@chrahunt
Copy link
Member

Hi everyone. It looks like @cjadeveloper got their pip fixed, so I'll close this. If you are still experiencing problems please create a new issue. Thanks!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Dec 27, 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