[英]ModuleNotFoundError: No module named 'PyDIP', although it's installed
Trying to work with image recognition, I installed Python with OpenCV, following this tutorial .尝试使用图像识别,我按照本教程安装了带有 OpenCV 的 Python。 Later on, I decided to give PyDIP a try, running the commands given on this answer .
后来,我决定尝试 PyDIP,运行此答案中给出的命令。
The first command just don't work:第一个命令不起作用:
>>> import PyDIP as dip
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyDIP'
I tried to install it using:我尝试使用以下方法安装它:
(cv) user@pc:~$ python -m pip install PyDIP
Requirement already satisfied: PyDIP in ./.virtualenvs/cv/lib/python3.7/site-packages (0.1.8)
The location of python and pip also seem correct: python 和 pip 的位置似乎也正确:
(cv) user@pc:~$ which -a python
/home/user/.virtualenvs/cv/bin/python
/usr/bin/python
/bin/python
(cv) user@pc:~$ which -a pip
/home/user/.virtualenvs/cv/bin/pip
/usr/local/bin/pip
I'm using a Virtual Environment (exactly as in the first link), thus the (cv)
on the prompt.我正在使用虚拟环境(与第一个链接中的完全相同),因此提示中使用了
(cv)
。 There are different Python versions installed, but as I've read, the first one listed with which
should be used.有安装了不同的Python版本,但我读过,第一个列出了
which
应该被使用。 If the python and pip executables are on the same folder as the PyDIP package, what's going on?如果 python 和 pip 可执行文件与 PyDIP 包在同一个文件夹中,发生了什么?
I'm using Debian 10, python 3.7.3 and pip 20.0.2.我正在使用 Debian 10、python 3.7.3 和 pip 20.0.2。
The project has top-level package pydip
(not PyDIP
).该项目具有顶级包
pydip
(不是PyDIP
)。 So import it:所以导入它:
import pydip as dip
AFAIU PyDIP
is a different package . AFAIU
PyDIP
是一个不同的包。
You are trying to install the PyDIP module by installing it with pip, but the Python Package Index says the pydip module on there is an您正在尝试通过使用 pip 安装 PyDIP 模块来安装它,但是Python 包索引说那里的 pydip 模块有一个
Adjudication logic engine for Diplomacy board game
外交棋盘游戏的裁决逻辑引擎
To install it you have to build it from source .要安装它,您必须从源代码构建它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.