ModuleNotFoundError:尽管已安装模块,但没有名为"PyDIP"的模块

问题描述:

尝试使用图像识别,我按照此答案上给出的命令.

Trying to work with image recognition, I installed Python with OpenCV, following this tutorial. Later on, I decided to give PyDIP a try, running the commands given on this answer.

第一个命令不起作用:

>>> 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)

python和pip的位置也似乎正确:

The location of python and pip also seem correct:

(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

我正在使用虚拟环境(与第一个链接完全相同),因此在提示符下显示(cv).安装了不同的Python版本,但据我所读,应该使用列在which的第一个.如果python和pip可执行文件与PyDIP软件包位于同一文件夹中,怎么回事?

I'm using a Virtual Environment (exactly as in the first link), thus the (cv) on the prompt. There are different Python versions installed, but as I've read, the first one listed with which should be used. If the python and pip executables are on the same folder as the PyDIP package, what's going on?

我正在使用Debian 10,python 3.7.3和pip 20.0.2.

I'm using Debian 10, python 3.7.3 and pip 20.0.2.

项目具有顶部级别程序包pydip(不是PyDIP).因此,导入它:

The project has top-level package pydip (not PyDIP). So import it:

import pydip as dip

AFAIU PyDIP其他程序包.