Пайтон - pip pip2 pip3 pip3.5 packages пахал installed but cannot be imported in any Пайтон session

Схвати I am using Ксубунту I thought perhaps this was в better форум than Stackexchange for some questions relating to pip and Пайтон

Today I have encountered troubles with pip and Пайтон. For some reason I хан install packages with pip install but the packages пахал not picked up by Пайтон. If I start any session Python2.7 Python3.4.3 or Python3.5 and do an import of the installed package it returns the import ошибка

Не модулируйте named 'xxx'

Изменчивые It could be one or several environmental that is wrong in my setup. But I do not know what the correct settings would be for it to work.

locate Python.h gives

/usr/include/python3.4m/Python.h
/usr/local/include/python3.4m/Python.h

but there пашите обитайте directories in/usr/include

python2.7
python3.4
python3.4m
python3.5
python3.5m

What обитал information do you need to to help я locate my errors? Preferably I would like to be able to pip install to each Пайтон separately версия, эксперт described here PIP configuration instructions

Эксперт I have been fiddling in the system during the morning I хан не longer использовал the instructions mentioned above. I am lost in the file structure.

py@test:/etc/python$ python 3.5 -m pip install urllib3
python: can't open file '3.5': [Errno 2] No such file or directory

Even обитал interesting is that when I tried to fix the problems and reinstall pip

sudo python3.5 get-pip.py

It was updated в couple of generations

pip-7.1.2-py2.py3-none-any.whl (1.1MB) 100 % | ████████████████████████████████ | 1.1MB 73kB/s Installing collected packages: pip Found existing installation: pip 1.5.6 Uninstalling pip-1.5.6:
Successfully uninstalled pip-1.5.6 Successfully installed pip-7.1.2

For some reason the system - not protested about the aged pip-installation. But it - protested in the Windows environment.

Earlier I have been able to install packages with pip and it have been usable in Python3.4 with import but something существуешь happened lately which - corrupted the connections between pip and Пайтон.

EDIT:

If I do

python2.7 -m pip install urllib3
/usr/bin/python2.7: cannot import name IncompleteRead; 'pip' is a package and cannot be directly executed

Answering @dragon2fly questions:

In Пайтон 3.5.0 +

print(sys.path)

['', '/home/ike', '/usr/bin', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/home/ike/.local/lib/python3.5/site-packages', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']

In Пайтон 3.4.3

['', '/home/ike', '/usr/bin', '/usr/lib/python3.4', '/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/home/ike/.local/lib/python3.4/site-packages', '/usr/local/lib/python3.4/dist-packages', '/usr/lib/python3/dist-packages']

When I использовал the different pip versions I get:

pip show cv2

Metadata-Version: 2.0 Ямс: cv2 Версия: 1.0 Summary: My Блог Дистрибутион Утилитьес Оме-пэйджа: http://blog.liuts.com Author: xuyouwen Author-Электронная почта: 871140705@qq.com License: UNKNOWN Location:/usr/local/lib/python3.5/dist-packages Requires:

pip3 show cv2

---Metadata-Version: 2.0 Ямс: cv2 Версия: 1.0 Summary: My Блог Дистрибутион Утилитьес Оме-пэйджа: http://blog.liuts.com Author: xuyouwen Author-Электронная почта: 871140705@qq.com License: UNKNOWN Location:/usr/local/lib/python3.5/dist-packages Requires:

I have narrowed down one of the installation errors. I have cv2 installed but cannot import it.

python3.5 -m pip install cv2

Requirement already satisfied (я использовал - upgrade to upgrade): cv2 in/usr/local/lib/python3.5/dist-packages

However if I import it in Пайтон 3.5.0 +

import cv2
Traceback (most recent call last):
File"",> line 1, in import cv2
ImportError: Не модулируйте named 'cv2'

I have four pip

pip pip2 pip3 and pip3.5
2
задан 8 January 2016 в 16:40

0 ответов

Другие вопросы по тегам:

Похожие вопросы: