pip: 19.3 doesn't work after upgrading from 19.2.3

Environment

  • pip version: 19.3
  • Python version: 3.7.3
  • OS: Windows 10

Description I used pip 19.2.3 and today I upgrade it to 19.3 in my system and it doesn’t work using pip command (image attached)

Expected behavior

How to Reproduce

  1. Using pip with version 19.2.3 upgrade to 19.3 with command “pip install --upgrade pip --user”
  2. Then run any command in pip.
  3. It’s going to throw an exception (same as image attached)

Output

C:\Users\<user>>pip --version
Traceback (most recent call last):
  File "c:\users\<user>\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\<user>\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37-32\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable

Workaround

  1. Copying the files from %AppData%\Roaming\Python\Python37-32\Scripts\pip* to %AppData%\Local\Programs\Python\Python37-32\Scripts\

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 22 (15 by maintainers)

Most upvoted comments

Hi @thijstriemstra. That seems like a separate issue, probably what happened is:

  1. In the first case the pip installation created the script in /usr/local/bin/pip3 and left the original in /usr/bin/pip3. The original is what is getting invoked and it has the old entrypoint location. The solution to this is to not use sudo pip install -U pip but pip install -U --user pip, otherwise it impacts your system at large in unexpected ways because distributions will have specific configuration for the system-wide pip.
  2. In the second case, bash has “hashed” (remembered) the location of the last pip3 that it previously invoked. You need to run hash pip3 after installation in order for it to pick up the new script. We have several issues open to add a warning for this case, notably #6863.

You may also check out #5599 for more information, it’s our go-to reference for these kinds of situations, but we could probably take this as a sign that it can be made more approachable/easily found.

If you still have problems, please create a separate issue. This one hasn’t had action in awhile so I will close it.