python opencv绑定包含在conda-forge上名为opencv
的软件包中,或包含在pypi上的opencv-python
的软件包中。在conda-forge上安装opencv
将使cv2
模块可用。但是,在通过conda安装此文件并根据Opencv pip install
打包软件包后,pip install
找不到现有的软件包。根据在setup.py
中调用该程序包的方式,它要么搜索程序包但找不到它,要么找到它并与conda版本一起安装。
$ conda list | grep opencv
opencv 4.1.0 py37h5517eff_4 conda-forge
如果setup.py
中的名称是opencv
,它将搜索(即使已经有opencv
)但找不到:
$ pip install .
Processing /home/gholl/checkouts/fogpy
Requirement already satisfied: numpy>=1.16 in /media/nas/x21324/miniconda3/envs/py37d/lib/python3.7/site-packages (from fogpy==1.1.3+dev92.gb109242.temp) (1.16.2)
Requirement already satisfied: scipy>=1.2 in /media/nas/x21324/miniconda3/envs/py37d/lib/python3.7/site-packages (from fogpy==1.1.3+dev92.gb109242.temp) (1.2.1)
Requirement already satisfied: matplotlib>=1.4.2 in /media/nas/x21324/miniconda3/envs/py37d/lib/python3.7/site-packages (from fogpy==1.1.3+dev92.gb109242.temp) (3.0.3)
Requirement already satisfied: pyorbital>=1.5.0 in /media/nas/x21324/miniconda3/envs/py37d/lib/python3.7/site-packages (from fogpy==1.1.3+dev92.gb109242.temp) (1.5.0)
Requirement already satisfied: trollimage>=1.8.0 in /media/nas/x21324/miniconda3/envs/py37d/lib/python3.7/site-packages (from fogpy==1.1.3+dev92.gb109242.temp) (1.8.0)
Requirement already satisfied: satpy>=0.15 in /media/nas/x21324/miniconda3/envs/py37d/lib/python3.7/site-packages (from fogpy==1.1.3+dev92.gb109242.temp) (0.15.1+38.gc7161c08)
Requirement already satisfied: pyresample>=1.11 in /media/nas/x21324/miniconda3/envs/py37d/lib/python3.7/site-packages (from fogpy==1.1.3+dev92.gb109242.temp) (1.11.2)
Collecting opencv>=4.1 (from fogpy==1.1.3+dev92.gb109242.temp)
Could not find a version that satisfies the requirement opencv>=4.1 (from fogpy==1.1.3+dev92.gb109242.temp) (from versions: )
No matching distribution found for opencv>=4.1 (from fogpy==1.1.3+dev92.gb109242.temp)
如果setup.py
中的名称为opencv-python
,它将在第一个名称旁边安装第二个opencv
,并且导入cv2
模块将导致未定义的符号错误。
我如何说服pip识别opencv的conda安装?