如何卸载在anaconda中使用pip安装的opencv-python包?

时间:2018-01-03 06:53:30

标签: python opencv anaconda

我曾尝试在anaconda中安装OpenCV。但是当我使用它时,我弄清楚而不是使用OpenCV,使用OpenCV-python的程序,以及我的程序崩溃的原因。 我键入“conda uninstall opencv”但它只是卸载OpenCV包而不是OpenCV-python。我也使用“conda uninstall opencv-python”和“pip uninstall opencv-python”,但它不起作用。

enter image description here

5 个答案:

答案 0 :(得分:2)

  1. 转到pip正在安装软件包的目录。
  2. 您应该能够看到与要卸载的包对应的egg文件。删除egg文件(或者,为了安全起见,将其移动到其他目录)。
  3. 对要删除的程序包的文件包执行相同的操作(opencv-python)

答案 1 :(得分:1)

根据official documentation,此问题必须非常容易解决:

pip uninstall opencv-python

答案 2 :(得分:0)

@LêHuyHùng

请在发布此类问题之前查看官方文件。

以下是pip uninstall

official documentation

以下是我如何卸载它

  

pip uninstall opencv-python

     

卸载opencv-python-3.4.0.12:
  /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/QtCore   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/QtGui   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/QtTest   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/libavcodec.57.1​​07.100.dylib   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/libavformat.57.83.100.dylib   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/libavresample.3.7.0.dylib   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/libavutil.55.78.100.dylib   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/libmp3lame.0.dylib   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/libswresample.2.9.100.dylib   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/.dylibs/libswscale.4.8.100.dylib   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/LICENSE-3RD-PARTY.txt   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/LICENSE.txt   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/init.py   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/pycache/init.cpython-35.pyc   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/cv2.cpython-35m-darwin.so   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/init.py   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/pycache/init.cpython-35.pyc   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_eye.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_eye_tree_eyeglasses.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_frontalcatface.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_frontalcatface_extended.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_frontalface_alt.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_frontalface_alt2.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_frontalface_alt_tree.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_frontalface_default.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_fullbody.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_lefteye_2splits.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_licence_plate_rus_16stages.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_lowerbody.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_profileface.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_righteye_2splits.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_russian_plate_number.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_smile.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/cv2/data/haarcascade_upperbody.xml   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/opencv_python-3.4.0.12.dist-info/DESCRIPTION.rst   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/opencv_python-3.4.0.12.dist-info/INSTALLER   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/opencv_python-3.4.0.12.dist-info/METADATA   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/opencv_python-3.4.0.12.dist-info/RECORD   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/opencv_python-3.4.0.12.dist-info/WHEEL   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/opencv_python-3.4.0.12.dist-info/metadata.json   /Users/name/.virtualenvs/LT/lib/python3.5/site-packages/opencv_python-3.4.0.12.dist-info/top_level.txt   继续(是/否)?   ÿ
  已成功卸载opencv-python-3.4.0.12

答案 3 :(得分:0)

要卸载,我使用了以下代码,它可以正常工作,

    sudo pip uninstall opencv-python

结果如下:

Uninstalling opencv-python-4.0.0.21:   Would remove:

    c:\program files\anaconda3\lib\site-packages\cv2\*
    c:\program files\anaconda3\lib\site-packages\opencv_python-4.0.0.21.dist-info\* Proceed (y/n)? y   Successfully uninstalled opencv-python-4.0.0.21

答案 4 :(得分:0)

我在终端上运行以下代码:pip uninstall opencv-python。它真的很好。 您可以看到: captured screen