I am getting the following error on my Raspberry Pi: No module named pip__main__; \'pip\' is a package and cannot be directly executed
When I type in to
I had the same issue and none of the previous answers solved it for me.
The error appeared when I uninstalled and reinstalled python to my PC. As it appears the previous existing version of pip wasn't completely removed and when I was trying to import it with python -m pip install package it was actually trying to call the previous version.
To solve it first manually delete the pip folders in the following locations:
C:\Users\username\pip
C:\Users\username\AppData\Local\pip
C:\Users\username\AppData\Local\Programs\Python\Python**\lib\site-packages\pip***
C:\Python**\pip
Then download get-pip.py.
Finally, navigate to the folder where you downloaded it and run:
python get-pip.py
This procedure should reinstall pip and fix the issue.