importerror no module named internal

Запуск pip или pip3 результатов:

У меня были проблемы с этим и удаленный pip3, но когда я попытаюсь установить его снова, используя

он устанавливает, но затем запускает pip или pip3, я получаю ту же ошибку.

Содержание

  1. 2 ответа
  2. 22 Answers 22
  3. 7 Answers 7

2 ответа

После обновления pip (или pip3 в этом случае), если происходит следующее:

Заставить переустановить pip:

Теперь pip3 install

и pip3 install —user

(для пользовательских установок) будут работать правильно.

Никогда не должно быть причин, по которым вам нужно запускать pip в повышенном режиме.

(примечание: для Python 2.7 просто замените python для python3 и pip для pip3 )

Имела ту же проблему и на macOS, это общая проблема на всех платформах.

I have a problem when I try to use pip in any way. I’m using Ubuntu 16.04.4

I should say that I’ve used it already, and I never had any problem, but starting today when I use any command I always get the same error (as an example using pip —upgrade ).

I have tried doing sudo apt-get remove python-pip followed by sudo apt-get install python-pip but nothing changed.

Thank you for your time!

22 Answers 22

This did it for me:

Environment: OSX && Python installed via brew

An answer from askUbuntu works.

For pip2.7, you can at first curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py , then python2.7 get-pip.py —force-reinstall to reinstall pip.

Problem solved. Also works for python3.

This solution works for me:

or use sudo for elevated permissions ( sudo python3 get-pip.py —force-reinstall ).

Of course, you can also use python instead of python3 😉

works for me under Mac OS

For python3 , may try sudo easy_install-3.x pip depends on the python 3.x version. Or python3 -m pip install —user —upgrade pip

This issue maybe due to common user do not have privilege to access packages py file.
1. root user can run ‘pip list’
2. other common user cannot run ‘pip list’

Check pip py file privilege.

solution : root user login and run

In file «/usr/local/bin/pip» change from pip._internal import main to from pip import main

I’ve seen this issue when PYTHONPATH was set to include the built-in site-packages directory. Since Python looks there automatically it is unnecessary and can be removed.

Are you using python2 or python3? The following command could be different!

  1. use python3 -m pip —version to see if you have pip installed.
  2. if yes, run python3 -m pip install —upgrade pip .
  3. if no, run sudo apt-get install python3-pip , and do it again.

Its probably due to a version conflict, try to run this, it will remove the older pip somehow.

/.local/bin instead. No more error message. – TheDudeAb > Dec 20 ’18 at 21:34

I just encountered the same problem and in my case, it turns out this is a conflict between the python installation in my virtualenv and the site-wide python (Ubuntu). What solves it for me is to run pip in this way, to force usage of the correct python installation (in my vortualenv):

I realised this when I tried to follow some of the answers here that suggest re-installing pip and the error output I got was pointing to an existing site-wide python library path although I had activated my virtualenv. Worth trying before deleting and re-installing stuff.

Running pip or pip3 results with:

I had issues with this, and uninstalled pip3, but when i try to install it again using

it does install, but then running pip or pip3 i get the same error.

– Benjamin R Apr 21 ’18 at 22:14

7 Answers 7

After upgrading pip (or pip3 , in this case) if the following occurs:

Force a reinstall of pip:

Now pip3 install

and pip3 install —user

(for user-level installs) will work correctly.

There should never, ever be any reason you need to run pip in elevated mode.

(note: For Python 2.7, just replace python for python3 , and pip for pip3 )

Had same problem on macOS as well, it’s a common issue across platforms.

Источник: computermaker.info

Техника и Гаджеты
Добавить комментарий