卸载 opencv-contrib-python and opencv-python

蒋鹏鹍
2023-12-01

卸载 opencv-contrib-python and opencv-python

1. pip - Python 2.x

strong@foreverstrong:~$ pip list | grep opencv
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
opencv-python                      3.4.1.15   
strong@foreverstrong:~$ 

2. pip3 - Python 3.x

strong@foreverstrong:~$ pip3 list | grep opencv
opencv-contrib-python (3.3.0.10)
opencv-python (3.4.0.12)
strong@foreverstrong:~$ 

3. 卸载 opencv-contrib-python

sudo pip3 uninstall opencv-contrib-python==3.3.0.10

strong@foreverstrong:~$ sudo pip3 uninstall opencv-contrib-python==3.3.0.10
[sudo] password for strong: 
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling opencv-contrib-python-3.3.0.10:
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libQtCore-ba1dc80c.so.4.8.7
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libQtGui-6d0f14dd.so.4.8.7
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libQtTest-1183da5d.so.4.8.7
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libz-a147dcb0.so.1.2.3
  /usr/local/lib/python3.5/dist-packages/cv2/LICENSE-3RD-PARTY.txt
  /usr/local/lib/python3.5/dist-packages/cv2/LICENSE.txt
  /usr/local/lib/python3.5/dist-packages/cv2/__init__.py
  /usr/local/lib/python3.5/dist-packages/cv2/__pycache__/__init__.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/cv2/cv2.cpython-35m-x86_64-linux-gnu.so
  /usr/local/lib/python3.5/dist-packages/opencv_contrib_python-3.3.0.10.dist-info/DESCRIPTION.rst
  /usr/local/lib/python3.5/dist-packages/opencv_contrib_python-3.3.0.10.dist-info/INSTALLER
  /usr/local/lib/python3.5/dist-packages/opencv_contrib_python-3.3.0.10.dist-info/METADATA
  /usr/local/lib/python3.5/dist-packages/opencv_contrib_python-3.3.0.10.dist-info/RECORD
  /usr/local/lib/python3.5/dist-packages/opencv_contrib_python-3.3.0.10.dist-info/WHEEL
  /usr/local/lib/python3.5/dist-packages/opencv_contrib_python-3.3.0.10.dist-info/metadata.json
  /usr/local/lib/python3.5/dist-packages/opencv_contrib_python-3.3.0.10.dist-info/top_level.txt
Proceed (y/n)? y
  Successfully uninstalled opencv-contrib-python-3.3.0.10
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
strong@foreverstrong:~$ 

4. 卸载 opencv-python

sudo pip3 uninstall opencv-python==3.4.0.12

strong@foreverstrong:~$ sudo pip3 uninstall opencv-python==3.4.0.12
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Uninstalling opencv-python-3.4.0.12:
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libavcodec-7625dabe.so.58.6.103
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libavformat-d3ca1b40.so.58.3.100
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libavutil-eaec640f.so.56.5.100
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libswresample-81cb7b3e.so.3.0.101
  /usr/local/lib/python3.5/dist-packages/cv2/.libs/libswscale-bc8d848b.so.5.0.101
  /usr/local/lib/python3.5/dist-packages/cv2/data/__init__.py
  /usr/local/lib/python3.5/dist-packages/cv2/data/__pycache__/__init__.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_eye.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_eye_tree_eyeglasses.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_frontalcatface.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_frontalcatface_extended.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_frontalface_alt.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_frontalface_alt2.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_frontalface_alt_tree.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_frontalface_default.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_fullbody.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_lefteye_2splits.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_licence_plate_rus_16stages.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_lowerbody.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_profileface.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_righteye_2splits.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_russian_plate_number.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_smile.xml
  /usr/local/lib/python3.5/dist-packages/cv2/data/haarcascade_upperbody.xml
  /usr/local/lib/python3.5/dist-packages/opencv_python-3.4.0.12.dist-info/DESCRIPTION.rst
  /usr/local/lib/python3.5/dist-packages/opencv_python-3.4.0.12.dist-info/INSTALLER
  /usr/local/lib/python3.5/dist-packages/opencv_python-3.4.0.12.dist-info/METADATA
  /usr/local/lib/python3.5/dist-packages/opencv_python-3.4.0.12.dist-info/RECORD
  /usr/local/lib/python3.5/dist-packages/opencv_python-3.4.0.12.dist-info/WHEEL
  /usr/local/lib/python3.5/dist-packages/opencv_python-3.4.0.12.dist-info/metadata.json
  /usr/local/lib/python3.5/dist-packages/opencv_python-3.4.0.12.dist-info/top_level.txt
Proceed (y/n)? y
  Successfully uninstalled opencv-python-3.4.0.12
The directory '/home/strong/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
strong@foreverstrong:~$

5. pip3 list | grep opencv

strong@foreverstrong:~$ pip3 list | grep opencv
strong@foreverstrong:~$ 

References

https://yongqiang.blog.csdn.net/

 类似资料: