Я в этом python3 virtualenv:
(base) marco@pc01:~/PyTorchMatters/facenet_pytorch/examples$ pyenv virtualenvs
3.7.3/envs/facenet_pytorch (created from /home/marco/.pyenv/versions/venv373)
3.7.3/envs/venv373 (created from /home/marco/.pyenv/versions/3.7.3)
* facenet_pytorch (created from /home/marco/.pyenv/versions/venv373)
venv373 (created from /home/marco/.pyenv/versions/3.7.3)
Насколько я понимаю, необходимый модуль уже установлен:
(base) marco@pc01:~/PyTorchMatters/facenet_pytorch/examples$ pip3 install facenet_pytorch
Requirement already satisfied: facenet_pytorch in /home/marco/.pyenv/versions/3.7.3
/envs/facenet_pytorch/lib/python3.7/site-packages (2.2.8)
Requirement already satisfied: requests in /home/marco/.pyenv/versions/3.7.3
/envs/facenet_pytorch/lib/python3.7/site-packages (from facenet_pytorch) (2.23.0)
Requirement already satisfied: numpy in /home/marco/.pyenv/versions/3.7.3
/envs/facenet_pytorch/lib/python3.7/site-packages (from facenet_pytorch) (1.18.1)
Requirement already satisfied: chardet<4,>=3.0.2 in /home/marco/.pyenv/versions/3.7.3
/envs/facenet_pytorch/lib/python3.7/site-packages (from requests->facenet_pytorch) (3.0.4)
Requirement already satisfied: idna<3,>=2.5 in /home/marco/.pyenv/versions/3.7.3
/envs/facenet_pytorch/lib/python3.7/site-packages (from requests->facenet_pytorch) (2.9)
Requirement already satisfied: certifi>=2017.4.17 in /home/marco/.pyenv/versions/3.7.3
/envs/facenet_pytorch/lib/python3.7/site-packages (from requests->facenet_pytorch)
(2019.11.28)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /home/marco/.pyenv
/versions/3.7.3/envs/facenet_pytorch/lib/python3.7/site-packages (from
requests->facenet_pytorch) (1.25.8)
И с заморозкой пипса вроде действительно установлено в его virtualenv:
(base) marco@pc01:~/PyTorchMatters/facenet_pytorch/examples$ pip3 freeze --local
certifi==2019.11.28
chardet==3.0.4
facenet-pytorch==2.2.8
idna==2.9
numpy==1.18.1
requests==2.23.0
urllib3==1.25.8
Но когда я пытаюсь выполнить этот однострочный код:
prova.py:
from facenet_pytorch import MTCNN
Я получаю ModuleNotFoundError : Нет модуля с именем 'facenet_pytorch'
(base) marco@pc01:~/PyTorchMatters/facenet_pytorch/examples$ python3 prova.py
Traceback (most recent call last):
File "prova.py", line 1, in <module>
from facenet_pytorch import MTCNN
ModuleNotFoundError: No module named 'facenet_pytorch'
- версия pip3: pip-20.0.2
- ОС: Ubuntu 18.04.4 Desktop
- python версия : Python 3.7.4
Update) РЕШЕНО: Простая установка с помощью установки pip (не pip3) решила проблему
Marco