简体   繁体   中英

Install opencv python package in Anaconda

Can someone provide the steps and the necessary links of the dependencies to install external python package "opencv-python" for image processing? I tried installing it in pycharm, but it was not able to import cv2(opencv) and was throwing version mismatch with numpy!

Please help!

The good thing with anaconda is that it should make your life easier without getting your hands too dirty. If you use only basic libs, only install packages with anaconda commands to be sure not to corrupt your python environment.

if you're on linux, use conda install -c conda-forge opencv

on windows, do the same with the "anaconda prompt" terminal.

If you still have some trouble with you numpy version, try conda update numpy

Create a virtual env. Following which run following instals pip install numpy scipy matplotlib scikit-learn jupyter pip install opencv-contrib-python pip install dlib

You may verify the install via this script in Python environment- import cv2 cv2. version

  1. Remove all previous/current (if any) python installation
  2. Install Anaconda and add anaconda to PATH(Envirnoment variables:: Adavanced system setting->Environment variables->under system variables go to variable PATHand click edit to add new envirnomental variables) (During installation check box involve PATH)
  3. Open anaconda prompt with admin access. Type and enter:-
    conda update --all
  4. conda install -c conda-forge opencv
  5. conda install spyder=4.0.0 (spyder updation)
  6. conda update python (for python updation)

To install this package with conda run one of the following:

conda install -c conda-forge opencv

conda install -c conda-forge/label/gcc7 opencv

conda install -c conda-forge/label/broken opencv

conda install -c conda-forge/label/cf201901 opencv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM