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 does not work after upgrade to v19.3 #7223

Closed
afarina2 opened this issue Oct 16, 2019 · 9 comments
Closed

pip does not work after upgrade to v19.3 #7223

afarina2 opened this issue Oct 16, 2019 · 9 comments
Labels
auto-locked Outdated issues that have been locked by automation type: support User Support

Comments

@afarina2
Copy link

  • Pip version:19.3
  • Python version:3.7 (32 bit)
  • Operating system: Windows 10

PIP does not run after upgrading to version 19.2. I have tried to re-install it through get-pip.py to no avail. What could be causing this?

Traceback (most recent call last):
File "c:\program files (x86)\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\program files (x86)\python37-32\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python37-32\Scripts\pip.exe_main
.py", line 9, in
TypeError: 'module' object is not callable

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Oct 16, 2019
@KVInventoR
Copy link

KVInventoR commented Oct 16, 2019

Have a similar issue with Linux:

Tried to upgrade from: pip (8.1.2) to latest:
pip install --upgrade pip

[root@ip-10-4-4-163 ~]# pip install --upgrade pip==19.3 Collecting pip==19.3 Cache entry deserialization failed, entry ignored Downloading https://files.pythonhosted.org/packages/4a/08/6ca123073af4ebc4c5488a5bc8a010ac57aa39ce4d3c8a931ad504de4185/pip-19.3-py2.py3-none-any.whl (1.4MB) 100% |████████████████████████████████| 1.4MB 858kB/s Installing collected packages: pip Found existing installation: pip 8.1.2 Uninstalling pip-8.1.2: Successfully uninstalled pip-8.1.2 Successfully installed pip-19.3 [root@ip-10-4-4-163 ~]# pip Traceback (most recent call last): File "/bin/pip", line 7, in <module> from pip._internal.main import main ImportError: No module named main

But when I did next:
pip install --upgrade pip==19.0
pip install --upgrade pip

19.3 worked well

What is wrong with 19.3 release?
`[root@ip-10-4-4-163 ~]# uname -a
Linux ip-10-4-4-163.us-west-2.compute.internal 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 30 14:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@ip-10-4-4-163 ~]# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)
[root@ip-10-4-4-163 ~]#
Python 2.7.5 (default, Aug 7 2019, 00:51:29)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib64/python2.7/lib-dynload/readline.so", 2);
import readline # dynamically loaded from /usr/lib64/python2.7/lib-dynload/readline.so

`

@pradyunsg
Copy link
Member

Duplicate of #7209

@pradyunsg pradyunsg marked this as a duplicate of #7209 Oct 16, 2019
@afarina2
Copy link
Author

afarina2 commented Oct 17, 2019

Thank you all for your assistance.
I am not able to execute anything with pip therefore the pip install —upgrade pip==19.0 did not work.
I also followed the instructions in #7209 and the issue persists. Copying the pip*files from the Roaming directory to Local did not do the trick.

What other options do I have with this.

@chrahunt
Copy link
Member

Hi @afarina2, please try executing all pip commands as python -m pip. If that does not work, please provide the output that you receive.

@chrahunt chrahunt reopened this Oct 17, 2019
@chrahunt chrahunt added S: awaiting response Waiting for a response/more information type: support User Support labels Oct 17, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Oct 17, 2019
@afarina2
Copy link
Author

@chrahunt, I tried running this (python -m pip install --force-reinstall pip==19.3 --user) as you suggested and although it executed properly, it caused pip to stop working all together again.

here is the output of that command plus my test for pip:

_C:\Users\adria\Downloads>python -m pip install --force-reinstall pip==19.3 --user
Collecting pip==19.3
Using cached https://files.pythonhosted.org/packages/4a/08/6ca123073af4ebc4c5488a5bc8a010ac57aa39ce4d3c8a931ad504de4185/pip-19.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.2.2
Uninstalling pip-19.2.2:
Successfully uninstalled pip-19.2.2
Successfully installed pip-19.3

C:\Users\adria\Downloads>pip -V
Traceback (most recent call last):
File "c:\program files (x86)\python37-32\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\program files (x86)\python37-32\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python37-32\Scripts\pip.exe_main
.py", line 9, in
TypeError: 'module' object is not callable

So far, the only thing that has restored pip functionality was to downgrade it to 19.2.2 (shown here with output). There seems to be something wrong with the 19.3 update for pip.

_C:\Users\adria\Downloads>python -m pip install --force-reinstall pip==19.2.2 --user
Collecting pip==19.2.2
Using cached https://files.pythonhosted.org/packages/8d/07/f7d7ced2f97ca3098c16565efbe6b15fafcba53e8d9bdb431e09140514b0/pip-19.2.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 19.3
Uninstalling pip-19.3:
Successfully uninstalled pip-19.3
Successfully installed pip-19.2.2

C:\Users\adria\Downloads>pip install six
Requirement already satisfied: six in c:\users\adria\appdata\roaming\python\python37\site-packages\six-1.12.0-py3.7.egg (1.12.0)
WARNING: You are using pip version 19.2.2, however version 19.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.__

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Oct 18, 2019
@chrahunt
Copy link
Member

Can you run python -m pip -V? I think the issue is that your globally-installed Python is on PATH ahead of the location of user-installed scripts, which should be in %APPDATA% if I recall correctly.

@afarina2
Copy link
Author

Thanks @chrahunt. I am actually able to run it!
C:\Users\adria>python -m pip -V
pip 19.3.1 from C:\Users\adria\AppData\Roaming\Python\Python37\site-packages\pip (python 3.7)

How do you recommend I fix the PATH problem?

@chrahunt
Copy link
Member

It may just be easier to always run pip as python -m pip.

If you really want a plain pip to work, then the goal is to make sure that

C:\Users\adria\AppData\Roaming\Python\Python37\Scripts

shows up before

C:\Program Files (x86)\Python37-32\Scripts

in the PATH environment variable. You can find some guidance here on how to edit environment variables on Windows. You'll also want to note the info on PATH combining between user and system here. Essentially you'll want to erase any Python directory from the system PATH then add the user Python directory followed by the system Python directory to your user PATH. That should make things behave as expected, potentially after restarting.

@chrahunt chrahunt added the S: awaiting response Waiting for a response/more information label Oct 18, 2019
@no-response
Copy link

no-response bot commented Nov 10, 2019

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Nov 10, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 10, 2019
@pradyunsg pradyunsg removed the S: awaiting response Waiting for a response/more information label Mar 17, 2023
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 type: support User Support
Projects
None yet
Development

No branches or pull requests

4 participants