Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip no longer working after update error 'module' object is not callable

After a pip update, pip has stopped working completely.

Z:\>pip install matplotlib Traceback (most recent call last):   File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main     "__main__", mod_spec)   File "c:\program files\python37\lib\runpy.py", line 85, in _run_code     exec(code, run_globals)   File "C:\Program Files\Python37\Scripts\pip.exe\__main__.py", line 9, in <module> TypeError: 'module' object is not callable 

Any help please?

Edit: I am working on windows 10

like image 547
Agustin Avatar asked Oct 18 '19 13:10

Agustin


People also ask

How do I fix Python module object is not callable?

The Python "TypeError: 'module' object is not callable" occurs when we import a module as import some_module but try to call it as a function or class. To solve the error, use dot notation to access the specific function or class before calling it, e.g. module. my_func() .

What is module object not callable?

It says module object is not callable, because your code is calling a module object. A module object is the type of thing you get when you import a module. What you were trying to do is to call a class object within the module object that happens to have the same name as the module that contains it.


2 Answers

All credit for this goes to user han_solo, who left the answer as a comment, instead of as an answer:

Instead of pip install stdlib_list --user

use python -m pip install stdlib_list --user

Replace stdlib_list with matplotlib or whatever the name is of the package you want.

like image 79
Toothpick Anemone Avatar answered Oct 03 '22 14:10

Toothpick Anemone


I've had the same issue as you, and I solved it uninstalling pip and installing again.

To uninstall: python -m pip uninstall pip

To install, follow the instructions: https://www.liquidweb.com/kb/install-pip-windows/

After that you will going to have a older but functional 19.0.3 version.

like image 24
rdemarqui Avatar answered Oct 03 '22 12:10

rdemarqui