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

Trying to execute module as a function #7206

Closed
ocket8888 opened this issue Oct 14, 2019 · 4 comments
Closed

Trying to execute module as a function #7206

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

Comments

@ocket8888
Copy link

ocket8888 commented Oct 14, 2019

Environment

  • pip version: 19.3
  • Python version: 3.6
  • OS: CentOS7

Description

pip 19.3 is trying to execute its 'main' module as though it were a function. I'm not sure where or why.
Expected behavior

The script that pip provides ought to run without crashing.

How to Reproduce

  1. Install pip v19.3
  2. Then run 'pip install '
  3. It crashes with TypeError: 'module' object is not callable

Output

$ pip3 install --upgrade pip && pip3 install requests urllib3 distro
 WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting pip
  Downloading https://files.pythonhosted.org/packages/4a/08/6ca123073af4ebc4c5488a5bc8a010ac57aa39ce4d3c8a931ad504de4185/pip-19.3-py2.py3-none-any.whl (1.4MB)
Installing collected packages: pip
Successfully installed pip-19.3
Traceback (most recent call last):
  File "/usr/bin/pip3", line 16, in <module>
    sys.exit(main())
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 14, 2019
@chrahunt
Copy link
Member

Hi @ocket8888. With the recent update you may be seeing issues like mentioned in #5599.

Your best bet is to try python3 -m pip install --upgrade pip && python3 -m pip install requests urllib3 distro, that should never break.

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

Yes that works. Should I leave the issue open or is it captured by #5599?

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

I would say captured by #5599. I left a comment there with your error message so it should be easily found. We may update the top post if it seems to be common.

Thanks for the report!

@R-Adrian
Copy link

R-Adrian commented Oct 30, 2019

side note, for future reference: i have also hit this error today, after i upgraded pip3, distro, install, requests and urllib3.... and i've discovered it's a side effect of having multiple versions of pip around, installed under multiple paths.

in my case below, /usr/bin/pip3 is the old, OS-packaged version of pip and if i run an upgrade then the new version will get installed under /usr/local/bin/pip3 BUT the shell will continue to use the old one that it has used already in that session, until i log out and back in.
At that point it will start to use the new pip.

# pip3 list
Traceback (most recent call last):
  File "/usr/bin/pip3", line 16, in <module>
    sys.exit(main())
TypeError: 'module' object is not callable

(logout and re-login here)

# which pip3
/usr/local/bin/pip3
# pip3 -V
pip 19.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

and ... it works again!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 2, 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 type: support User Support
Projects
None yet
Development

No branches or pull requests

3 participants