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

pip update kill pip #9566

Closed
1 task done
LaurentBerger opened this issue Feb 6, 2021 · 13 comments · Fixed by #10560
Closed
1 task done

pip update kill pip #9566

LaurentBerger opened this issue Feb 6, 2021 · 13 comments · Fixed by #10560
Labels
C: upgrade The logic of upgrading packages type: bug A confirmed bug or unintended behavior

Comments

@LaurentBerger
Copy link

LaurentBerger commented Feb 6, 2021

pip version

20.3.3

Python version

3.8.5

OS

windows 10

I have got only one version of python and python is in my path.

No response

Description

pip suggest me to update my pip version.
I have done it.
Update cannot be done and now my previous pip 20.3.3 is uninstalled.

Expected behavior

install is not possible so reinstall previous pip

How to Reproduce

see console (command) output

Output

Microsoft Windows [version 10.0.19041.746]
(c) 2020 Microsoft Corporation. Tous droits réservés.

C:\Users\Laurent>pip list
Package                Version
---------------------- ------------
-ip                    20.2.3
-umpy                  1.18.5
absl-py                0.10.0
aiofile                3.3.3
aiohttp                3.7.3
asgiref                3.2.10
astroid                2.4.2
astunparse             1.6.3
async-timeout          3.0.1
asyncio                3.4.3
attrs                  20.3.0
beautifulsoup4         4.9.1
cachetools             4.1.1
caio                   0.6.3
certifi                2020.6.20
cffi                   1.14.3
chardet                3.0.4
colorama               0.4.3
cycler                 0.10.0
dj-database-url        0.5.0
Django                 3.1
django-classy-tags     2.0.0
django-cms             3.8.0
django-debug-toolbar   3.2
django-floppyforms     1.9.0
django-formtools       2.2
django-matplotlib      0.1
django-sekizai         2.0.0
django-tables2         2.3.3
django-treebeard       4.3.1
djangocms-admin-style  2.0.2
flake8                 3.8.3
flatbuffers            1.12
gast                   0.3.3
geographiclib          1.50
geopy                  2.0.0
google-auth            1.21.0
google-auth-oauthlib   0.4.1
google-pasta           0.2.0
grpcio                 1.32.0
h5py                   2.10.0
idna                   2.10
intel-openmp           2021.1.1
isort                  5.4.2
Keras-Preprocessing    1.1.2
kiwisolver             1.2.0
lazy-object-proxy      1.4.3
Markdown               3.2.2
matplotlib             3.3.1
mccabe                 0.6.1
mkl                    2021.1.1
multidict              5.1.0
numpy                  1.19.2
oauthlib               3.1.0
opencv-contrib-python  4.4.0.46
opt-einsum             3.3.0
overloading            0.5.0
Pillow                 7.2.0
pip                    20.3.3
protobuf               3.13.0
psycopg2-binary        2.8.6
pyasn1                 0.4.8
pyasn1-modules         0.2.8
pycodestyle            2.6.0
pycparser              2.20
pydub                  0.24.1
pyflakes               2.2.0
pylint                 2.6.0
pyparsing              2.4.7
python-dateutil        2.8.1
pytz                   2020.1
requests               2.24.0
requests-oauthlib      1.3.0
rsa                    4.6
scipy                  1.4.1
setuptools             49.6.0
sitemap-generator      0.9.2
six                    1.15.0
sounddevice            0.4.0
SoundFile              0.10.3.post1
soupsieve              2.0.1
sqlparse               0.3.1
style                  1.1.0
tbb                    2021.1.1
tensorboard            2.4.0
tensorboard-plugin-wit 1.7.0
tensorflow             2.4.0
tensorflow-estimator   2.4.0
termcolor              1.1.0
toml                   0.10.1
typing-extensions      3.7.4.3
update                 0.0.1
urllib3                1.25.10
Werkzeug               1.0.1
wheel                  0.35.1
whitenoise             5.2.0
wrapt                  1.12.1
wxPython               4.1.0
yarl                   1.6.3
WARNING: You are using pip version 20.3.3; however, version 21.0.1 is available.
You should consider upgrading via the 'f:\program files\python\python.exe -m pip install --upgrade pip' command.

C:\Users\Laurent>
C:\Users\Laurent>
C:\Users\Laurent>pip install --upgrade pip
Requirement already satisfied: pip in f:\program files\python\lib\site-packages (20.3.3)
Collecting pip
  Downloading pip-21.0.1-py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 6.4 MB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.3.3
    Uninstalling pip-20.3.3:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Accès refusé: 'f:\\program files\\python\\scripts\\pip.exe'
Consider using the `--user` option or check the permissions.



C:\Users\Laurent>pip list
Traceback (most recent call last):
  File "f:\program files\python\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "f:\program files\python\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "F:\Program Files\Python\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'

Code of Conduct

  • I agree to follow the PSF Code of Conduct
@LaurentBerger LaurentBerger added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Feb 6, 2021
@mstouk57g
Copy link

Me too. And I don't know why. Then I use easy_setup to install pip.

@DiddiLeija
Copy link
Member

Does python -m pip install --upgrade pip work on your case?

@DiddiLeija DiddiLeija added the S: awaiting response Waiting for a response/more information label Aug 25, 2021
@LaurentBerger
Copy link
Author

@DiddiLeija sorry for delay.
I tried :

C:\Users\Laurent>pip --version
pip 21.2.4 from F:\Program Files\Python\lib\site-packages\pip (python 3.8)

C:\Users\Laurent>python -m pip install  pip==21.2.3
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Collecting pip==21.2.3
  Using cached pip-21.2.3-py3-none-any.whl (1.6 MB)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Installing collected packages: pip
  Attempting uninstall: pip
    WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
    Found existing installation: pip 21.2.4
    Uninstalling pip-21.2.4:
      Successfully uninstalled pip-21.2.4
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Successfully installed pip-21.2.3
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)

C:\Users\Laurent>pip --version
pip 21.2.3 from F:\Program Files\Python\lib\site-packages\pip (python 3.8)

C:\Users\Laurent>python -m pip install --upgrade pip
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Requirement already satisfied: pip in f:\program files\python\lib\site-packages (21.2.3)
Collecting pip
  Using cached pip-21.2.4-py3-none-any.whl (1.6 MB)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Installing collected packages: pip
  Attempting uninstall: pip
    WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
    Found existing installation: pip 21.2.3
    Uninstalling pip-21.2.3:
      Successfully uninstalled pip-21.2.3
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Successfully installed pip-21.2.4
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)

C:\Users\Laurent>pip --version
pip 21.2.4 from F:\Program Files\Python\lib\site-packages\pip (python 3.8)

C:\Users\Laurent>pip install  pip==21.2.3
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Collecting pip==21.2.3
  Using cached pip-21.2.3-py3-none-any.whl (1.6 MB)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
Installing collected packages: pip
  Attempting uninstall: pip
    WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
    Found existing installation: pip 21.2.4
    Uninstalling pip-21.2.4:
ERROR: Could not install packages due to an OSError: [WinError 5] Accès refusé: 'f:\\program files\\python\\scripts\\pip.exe'
Consider using the `--user` option or check the permissions.

WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)

C:\Users\Laurent>pip --version
Traceback (most recent call last):
  File "F:\Program Files\Python\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "F:\Program Files\Python\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "F:\Program Files\Python\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'

python -m pip install --upgrade pip works on windows
pip install --upgrade pip kills evrything

Doc is good
comment when upgrade is necessary is good too

I should read manual
I think this issue can be closed

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Sep 6, 2021
@DiddiLeija
Copy link
Member

As you can see, using python -m pip install --upgrade pip works fine , when pip install --upgrade pip (the pip executable) fails. On Windows, it is better to use the python -m pip command.

Also, can you try pip install --user --upgrade pip? I would like to know if this works.

@DiddiLeija DiddiLeija added S: awaiting response Waiting for a response/more information C: upgrade The logic of upgrading packages and removed S: needs triage Issues/PRs that need to be triaged labels Sep 6, 2021
@LaurentBerger
Copy link
Author

no problem 👍

C:\Users\Laurent>python -m pip install  pip==21.2.3
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
Collecting pip==21.2.3
  Using cached pip-21.2.3-py3-none-any.whl (1.6 MB)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
Installing collected packages: pip
  Attempting uninstall: pip
    WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
    WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
    Found existing installation: pip 21.2.4
    Uninstalling pip-21.2.4:
      Successfully uninstalled pip-21.2.4
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
Successfully installed pip-21.2.3
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)

C:\Users\Laurent>pip --version
pip 21.2.3 from F:\Program Files\Python\lib\site-packages\pip (python 3.8)

C:\Users\Laurent>pip install --user --upgrade pip
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
Requirement already satisfied: pip in f:\program files\python\lib\site-packages (21.2.3)
Collecting pip
  Using cached pip-21.2.4-py3-none-any.whl (1.6 MB)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
Installing collected packages: pip
  WARNING: The scripts pip.exe, pip3.8.exe and pip3.exe are installed in 'C:\Users\Laurent\AppData\Roaming\Python\Python38\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.2.4
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'F:\Program Files\Python\python.exe -m pip install --upgrade pip' command.

C:\Users\Laurent>pip --version
pip 21.2.4 from C:\Users\Laurent\AppData\Roaming\Python\Python38\site-packages\pip (python 3.8)

It works but error message is wrong :

WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'F:\Program Files\Python\python.exe -m pip install --upgrade pip' command.

C:\Users\Laurent>pip --version
pip 21.2.4 from C:\Users\Laurent\AppData\Roaming\Python\Python38\site-packages\pip (python 3.8)

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Sep 6, 2021
@DiddiLeija
Copy link
Member

Hmm, interesting.

This is not related, but I would like to know where does - and -ip came from, based on this warnings:

WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (f:\program files\python\lib\site-packages)
WARNING: Ignoring invalid distribution - (f:\program files\python\lib\site-packages)

@DiddiLeija
Copy link
Member

Another side note: What is F:/? Is it a separate disk drive? Because I think it could be closely related to your problem.

@pfmoore
Copy link
Member

pfmoore commented Sep 7, 2021

-ip almost certainly comes from a -ip.dist-info directory in site-packages, which is caused when a pip install fails (we rename the dist-info file to have the first character replaced by - before deleting it, to make the creation of the dist-info directory atomic). You can likely remove that directory.

The - distribution is probably similar, coming from a package with a single-character name.

@LaurentBerger
Copy link
Author

@DiddiLeija
f:\ is a disk drive

About -ip I delete many files in site package folder :
image

message WARNING: Ignoring invalid distribution is gone

@DiddiLeija
Copy link
Member

DiddiLeija commented Sep 7, 2021

Hmm... how did you installed Python? Or did you build Python from source on F:/?

@LaurentBerger
Copy link
Author

I installed python using exe file from python.org

@DiddiLeija
Copy link
Member

Did you use custom options during installation (I mean, on the Python installation GUI)?

@baterflyrity
Copy link

baterflyrity commented Sep 10, 2021

Hi there. Here is a fix at #10454.

Another quick fix is to run the command in administrator shell/user that have write access to f:\program files\python\scripts\ as stated in the error message.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C: upgrade The logic of upgrading packages type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants