-1

Newbie question here. I am teaching myself to code using Automate the Boring Stuff With Python and I'm stuck as I can't seem to set up pip. Here is the error message:

C:\Users\Rayanne>pip --version

Traceback (most recent call last):
  File "C:\Users\Rayanne\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Rayanne\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Rayanne\AppData\Local\Programs\Python\Python310\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip._internal'; 'pip' is not a package

I have tried reinstalling python and followed some tutorials online. Even though I install pip successfully, the same error appears. Have I accidentally deleted the pip._internal module? Any help would be appreciated!

Thank you!

MisterMiyagi
  • 44,374
  • 10
  • 104
  • 119
muning
  • 1
  • 1

2 Answers2

-1

Turns out I have a file named 'pip.py' and that was interrupting pip in cmd. I solved the problem simply by renaming said file.

Thank you so much!

muning
  • 1
  • 1
-2

Have you tried to run pip or the python executable from the installation folder? For example open the cmd shell in: C:\Users\Rayanne\AppData\Local\Programs\Python\Python310 and execute: .\python.exe -m pip --version or open the cmd shell in: C:\Users\Rayanne\AppData\Local\Programs\Python\Python310\Scripts and execute: .\pip.exe --version

If it is working, you have to check your windows path variable.

blackbrandt
  • 2,010
  • 1
  • 15
  • 32
jscman
  • 9
  • 5
  • Hey! Thanks so much for answering! I tried your suggestion and it still shows the same error :( – muning Feb 15 '22 at 16:14