Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to change pip.internal import main to pip?


Asked by Fallon Fischer on Dec 09, 2021 FAQ



In file "/usr/local/bin/pip" change from pip._internal import main to from pip import main For completeness, I just encountered this problem with "Ubuntu latest" ... v18.04 ... and fixed it in this way: (Notice that it was necessary to specify python3 since this references Python 3.6.9.
Subsequently,
While I appreciate that the underlying issue reported here and in #5221 is the environment, the cause is primarily that the import from pip import main was broken as the package pip.main was moved to pip._internal.main.
Moreover, The second may give /usr/bin/python: No module named pip Even if which pip finds the module named pip. In this case try the easy_install My python is installed via Anaconda. I solved this issue by reinstalling pip via conda: After that, pip returns to normal.
Furthermore,
The pip3command you're seeing is one provided by your package maintainer (presumably debian based here?) and is not a file managed by pip. You can read more about this on pip's issue tracker You'll probably want to notupgrade your system pip and instead use a virtualenv.
Also,
On Windows the configuration file is %APPDATA%pippip.ini. There are also a legacy per-user configuration file which is also respected, these are located at: On Unix and macOS the configuration file is: $HOME/.pip/pip.conf. On Windows the configuration file is: %HOME%pippip.ini.