0

I'm running Windows 10 with Python 3.7 and Microsoft Visual Studio Code. I want to install some packages I've downloaded (pysimplegui and psycopg2) but every time I try to install I get an error like this in cmd. Even when I type the pip list command

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

The files are in my programming folder and I've copied them also on the scripts folder but it's not working. Can you please help me ? thanks in advannce

SitiSchu
  • 1,361
  • 11
  • 20
Andy
  • 11
  • 1
  • 3
  • Check if python or pip is set in your environment variables and try again. If it still doesn't work try ```python -m pip install [package] --user``` – Felipe Endlich Nov 27 '19 at 12:23
  • Why not use `pip install psycopg2` ? – SitiSchu Nov 27 '19 at 12:36
  • Because the error you're getting is "module object is not callable", and when you use python -m, you're explicitly telling windows that pip is a module from python and you want to run it in that context. If you want to avoid overtyping just create an alias from 'python -m pip' to 'pip' – Felipe Endlich Nov 27 '19 at 12:42
  • 1
    Does this answer your question? [pip no longer working after update error 'module' object is not callable](https://stackoverflow.com/questions/58451650/pip-no-longer-working-after-update-error-module-object-is-not-callable) – Peter Brittain Nov 27 '19 at 14:28
  • Thanks A lot ! Finally it installed it usin python -m pip install psycopg2. Previously i was typing pip install psycopg2 and i was getting this error. Thanks a lot guys. But actually Felipe Endlich how do you do that ? changing for 'python -m pip' to 'pip' – Andy Nov 28 '19 at 11:35

1 Answers1

0

Try using this code python3 -m pip install library_you_want

AbdulRahim Khan
  • 121
  • 1
  • 3