I have been trying to install gdal on jupyter notebook but it is giving error that module not found but from command prompt if I activate the same environment it shows what is expected.
I am using python version 3.7 and windows 10. I installed gdal from conda as well as from jupyter notebook but same error.
The current convention to import gdal is
from osgeo import gdal
If that doesn't work then you are missing the python bindings for gdal. If you have indeed a working gdal installation, try to install the python bindings with pip:
pip install gdal==$(gdal-config --version)
at which point you should be able to import gdal in python.
I tried to install OpenCV in so many ways. I tried this tutorial:
https://docs.opencv.org/master/d0/db2/tutorial_macos_install.html
I tried using conda:
conda install -c conda-forge opencv
etc. etc.
But when I type in import cv2 it says:
PyCharm Image OpenCV
Does somebody have an idea?
To install opencv you can either build it with CMake (like the link you tagged) or install a pre-built version of it (easier).
You can do the pre-built via PyCharm going to your project settings and adding the 'opencv-python' package or running pip install opencv-python
If you need both main and contrib modules you can install 'opencv-contrib-python' instead
Here's the package's page: https://pypi.org/project/opencv-python/
I am a beginner at computers. I use Anaconda python 3.6 in windows 10. I have already installed OpenCV using this command:
pip install opencv-python
But when I try to import cv2 using this:
import cv2
this error shows up:
How can I install openCV for python?
Based on python opencv link: https://pypi.org/project/opencv-python/
Step 1:
Uninstall the opencv first if you have previous/other manually installed (= not installed via pip) version of OpenCV installed (e.g. cv2 module in the root of Python's site-packages)):
pip uninstall opencv-python
Step 2:
Install the package afresh
pip install opencv-python
Hope that works!
try this:
Create Virtual Environment
conda create --name opencv-env python=3.6
Activate the environment
activate opencv-env
Install OpenCV and other important packages
pip install numpy scipy matplotlib scikit-learn jupyter
pip install opencv-contrib-python
pip install dlib
Test your installation
import cv2
cv2.__version__
In my case, using Python 3.8 on Windows 10 and Pycharm (or VS Code as well), I have this same issue.
Finally I noticed that the Antivirus (Nod32) deletes the cv2.cp38-win32.pyd file that should be in the cv2 folder. I simply paused the protection, installed opencv with pip install opencv-python command and it worked just fine.
I hope it helps someone.
This happened to me because I setup a virtual environment with python 32-bit and my modules required the 64-bit version so it seemed there was a version conflict of CV. Changing the python version in my environment fixed the issue.
I was facing a similar issue. In my case, the issue occured because of previous dependencies.
!pip install easyocr
!pip install imutils
if you are running these commands first and then importing
import cv2
from matplotlib import pyplot as plt
import numpy as np
import imutils
import easyocr
then you will get this error. So you first import CV2 and then pip install easyocr or other libraries. This worked in my case.
I used the answer provided here and it worked.
By running pip install opencv_python-3.4.5-cp36-cp36m-win_amd64.whl
I had this exact same problem on Windows 10. Uninstalling via pip and then reinstalling in my virtual environment fixed everything up for me.
Here's a link that helped https://pypi.org/project/opencv-python/
Try reinstalling openCV — it worked for me.
To uninstall:
pip uninstall opencv-python
To reinstall:
pip install opencv-python
I have installed face_recognition model using command
pip3 install face_recognition
and it is installed in my AWS instance. But while importing face_recognition in my jupyter notebook it is giving me import error.
Thanks
Are you using a python environment? you have to make sure that the python interpreter that is running your code is the same one that has the face_recognition requirement installed.
I've installed opencv using following command:
pip3 install opencv-python
And I'm using anaconda environment to run my code on Jupyter notebook. But When I try to import opencv like following:
import cv2
It gives a dialog with Python has stopped working. I've also tried to install opencv via conda like following:
conda install -c menpo opencv
But this gives error:
following spec. found conflict
-opencv
-python 3.5*
So what am I missing here?
Okay I figured out the solution. Just ran the following command and now it's working.
conda install -c menpo opencv3