|
安装图像增强库imgaug会影响opencv的使用
- (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 install opencv-python
- Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
- Collecting opencv-python
- Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c0/a9/9828dfaf93f40e190ebfb292141df6b7ea1a2d57b46263e757f52be8589f/opencv_python-4.1.2.30-cp36-cp36m-manylinux1_x86_64.whl (28.3MB)
- |████████████████████████████████| 28.3MB 23kB/s
- Requirement already satisfied: numpy>=1.11.3 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from opencv-python) (1.18.0)
- Installing collected packages: opencv-python
- Successfully installed opencv-python-4.1.2.30
- (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 install imgaug
- Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
- Collecting imgaug
- Downloading https://pypi.tuna.tsinghua.edu.cn/packages/11/df/5a3bba95b4600d5ca7aff072082ef0d9837056dd28cc4e738e7ce88dd8f8/imgaug-0.3.0-py2.py3-none-any.whl (819kB)
- |████████████████████████████████| 829kB 1.1MB/s
- Requirement already satisfied: six in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (1.13.0)
- Requirement already satisfied: scipy in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (1.4.1)
- Collecting opencv-python-headless
- Downloading https://pypi.tuna.tsinghua.edu.cn/packages/5d/96/b2824df85d8c5f148125e4fee073a62fde17639502fe67042b212ebfe488/opencv_python_headless-4.1.2.30-cp36-cp36m-manylinux1_x86_64.whl (21.8MB)
- |████████████████████████████████| 21.8MB 10.6MB/s
- Collecting scikit-image>=0.14.2
- Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c8/bb/771800366f41d66eef51e4b80515f8ef7edab234a3f244fdce3bafe89b39/scikit_image-0.16.2-cp36-cp36m-manylinux1_x86_64.whl
- Collecting Shapely
- Using cached https://pypi.tuna.tsinghua.edu.cn/packages/38/b6/b53f19062afd49bb5abd049aeed36f13bf8d57ef8f3fa07a5203531a0252/Shapely-1.6.4.post2-cp36-cp36m-manylinux1_x86_64.whl
- Collecting imageio
- Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1a/de/f7f985018f462ceeffada7f6e609919fbcc934acd9301929cba14bc2c24a/imageio-2.6.1-py3-none-any.whl
- Requirement already satisfied: Pillow in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (6.2.1)
- Requirement already satisfied: matplotlib in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (3.1.2)
- Requirement already satisfied: numpy>=1.15 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from imgaug) (1.18.0)
- Collecting networkx>=2.0
- Using cached https://pypi.tuna.tsinghua.edu.cn/packages/41/8f/dd6a8e85946def36e4f2c69c84219af0fa5e832b018c970e92f2ad337e45/networkx-2.4-py3-none-any.whl
- Collecting PyWavelets>=0.4.0
- Using cached https://pypi.tuna.tsinghua.edu.cn/packages/59/bb/d2b85265ec9fa3c1922210c9393d4cdf7075cc87cce6fe671d7455f80fbc/PyWavelets-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
- Requirement already satisfied: python-dateutil>=2.1 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (2.8.1)
- Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (2.4.5)
- Requirement already satisfied: kiwisolver>=1.0.1 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (1.1.0)
- Requirement already satisfied: cycler>=0.10 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from matplotlib->imgaug) (0.10.0)
- Requirement already satisfied: decorator>=4.3.0 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from networkx>=2.0->scikit-image>=0.14.2->imgaug) (4.4.1)
- Requirement already satisfied: setuptools in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib->imgaug) (42.0.2.post20191203)
- Installing collected packages: opencv-python-headless, networkx, PyWavelets, imageio, scikit-image, Shapely, imgaug
- Successfully installed PyWavelets-1.1.1 Shapely-1.6.4.post2 imageio-2.6.1 imgaug-0.3.0 networkx-2.4 opencv-python-headless-4.1.2.30 scikit-image-0.16.2
复制代码
主要是因为:安装imgaug时会安装opencv-python-headless(这个在捣乱)
执行以下几步:
pip3 uninstall opencv-python-headless
pip3 uninstall opencv-python
pip3 install opencv-python
之后OpenCV可以正常imread imshow啦 我亲自遇到过的
- (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 uninstall opencv-python-headless
- Uninstalling opencv-python-headless-4.1.2.30:
- Would remove:
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/*
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/opencv_python_headless-4.1.2.30.dist-info/*
- Would not remove (might be manually added):
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtCore-bbdab771.so.4.8.7
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtGui-903938cd.so.4.8.7
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtTest-1183da5d.so.4.8.7
- Proceed (y/n)? y
- Successfully uninstalled opencv-python-headless-4.1.2.30
- (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 uninstall opencv-python
- Uninstalling opencv-python-4.1.2.30:
- Would remove:
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtCore-bbdab771.so.4.8.7
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtGui-903938cd.so.4.8.7
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/cv2/.libs/libQtTest-1183da5d.so.4.8.7
- /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages/opencv_python-4.1.2.30.dist-info/*
- Proceed (y/n)? y
- Successfully uninstalled opencv-python-4.1.2.30
- (py3_tf1_gpu_torch) dfy888@Dfy888-Ubuntu:~/py3_tf1_gpu_torch_works$ pip3 install opencv-python
- Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
- Collecting opencv-python
- Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c0/a9/9828dfaf93f40e190ebfb292141df6b7ea1a2d57b46263e757f52be8589f/opencv_python-4.1.2.30-cp36-cp36m-manylinux1_x86_64.whl
- Requirement already satisfied: numpy>=1.11.3 in /home/dfy888/miniconda3/envs/py3_tf1_gpu_torch/lib/python3.6/site-packages (from opencv-python) (1.18.0)
- Installing collected packages: opencv-python
- Successfully installed opencv-python-4.1.2.30
复制代码
|
|