-2

When i create a project by Pycharm in Anconda environment, use : conda info --envs i get this :

    base                     C:\Users\Admin\Anaconda3
    env_dlib                 C:\Users\Admin\Anaconda3\envs\env_dlib
    opencv-env               C:\Users\Admin\Anaconda3\envs\opencv-env       

then use command : conda activate env_dilb i can import dlib easily by using this command :python then import dlib, but i can not import cv2 by import cv2, it get notice : "ModuleNotFoundError: No module named 'cv2'".

And conversely when i use conda activate opencv-env, I can only do import cv2. How can i import two of both, and some other libraries too.

Ky Doan
  • 1
  • 2
  • what is the output of "conda list" and "pip freeze" commands after activating environment "env_dlib" – Lakshmi - Intel Nov 12 '19 at 14:54
  • output of "conda list:" ```certifi dlib intel-openmp jpeg libblas libcblas liblapack libpng mkl numpy pip python setuptools sqlite vc vs2015_runtime wheel wincertstore zlib``` – Ky Doan Nov 12 '19 at 15:10
  • and output of "pip freeze": ```certifi==2019.9.11 numpy==1.17.3 wincertstore==0.2``` – Ky Doan Nov 12 '19 at 15:12

1 Answers1

0

In the environment "dlib" package is available but "opencv" is not available.

Please follow the below steps to install opencv in the environment:

conda activate env_dlib
pip install opencv-python

After that try importing opencv using below command:

import cv2
Lakshmi - Intel
  • 581
  • 3
  • 10