I am importing libraries that I installed using pip install
to Jupyter Notebook using the anaconda distribution, which is working. Next, I am trying to import the same libraries in the anaconda command prompt and running it. I am getting this error message:
ModuleNotFoundError: No module named 'cv2'
try these things:
First check if you are able to see your library by this command: $ pip list or conda list
if not available install this module: $ pip install opencv-python or conda install opencv-python
But before that, try to check numpy module is available or not. If numpy is not available, then install this first. $ pip install numpy
If all of them exist then, Uninstall opencv-python and numpy first and upgrade your pip using the below command. $ pip install --upgrade pip
Two options to install cv2 with the latest conda & python3:
Open the Anaconda Prompt and switch to your environment:
$ conda activate myenv
Then install opencv from the menpo channel:
$ conda install -c menpo opencv
Open the Anaconda Prompt with admin permission and make sure you're in the base environment: $ conda activate base
Then install opencv from the menpo channel:
$ conda install -c menpo opencv
Reconnect your notebook to the kernel to import cv2.
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.