The problem: When I command import cv2 on Jupyter notebook I get a ModuleNotFoundError: "No module named 'cv2'".
What I have tried: On Anaconda I wrote py -m pip install opencv-python and also conda install opencv as suggested in this question. I also tried the command pip install opencv-python as explained in step 2 in this manual. But every time I got the same error (on Jupyter notebook).
I would like for help, thank you.
Install a pip package in the current Jupyter kernel
I've run into similar issues and this article helped me out. You can try installing it from within the Jupyter Notbeook Kernel.
import sys
!{sys.executable} -m pip install opencv-python
Article I reference
try pip3 install opencv-python
also try pip3 install opencv-python== to see all the available versions
Related
I have installed kmapper since command prompt, but when I import kmapper in jupyter notebook
is visualized a error: No module named kmapper.
What can I do?
I should install kmapper, please help me.
I don't see a Conda version for this in a major Anaconda Cloud channel. Install with pip.
conda create -n my_kmapper_env python pip numpy matplotlib scikit-learn bokeh pillow
conda activate my_kmapper_env
pip install kmapper
I am trying to use run the following commands in Jupyter notebook :
import ipywidgets
import plotly.graph_objs as go
print(ipywidgets.__version__)
f = go.FigureWidget()
f
I am getting the following error
ImportError: Please install ipywidgets>=7.0.0 to use the FigureWidget class
My ipywidgets version is 7.5.1. How to resolve this issue ?
I had the same issue. I first upgraded my pip by finding the location of python.exe and running python.exe -m pip install --upgrade pip on my Terminal.
WARNING: You are using pip version 20.3.3; however, version 21.1.1 is available.
You should consider upgrading via the '~\Documents\python_projects\lost_sales_validation\venv_lost_sales\Scripts\python.exe -m pip install --upgrade pip' command.
Once I had the most updated version of pip I ran pip install ipywidgets --upgrade.
On my jupyter notebook, running import sknw throws a ModuleNotFoundError error.
I have tried pip install sknw and pip3 install sknw and python -m pip install sknw. It appears to have downloaded successfully, and get requirement already satisfied if I try to download it again.
Any help on how to get the sknw package to work in jupyter notebook would be very helpful!
check on which environment you using pip.
I am trying to install 2 python packages on Anaconda Jupyter Notebook. The links to the python packages are as follow:
1) https://iapws.readthedocs.io/en/latest/modules.html
2) https://pythonhosted.org/thermopy/iapws.html#module-thermopy.iapws
But I am getting the following error on both installations. Can anyone tell me what is wrong?
Through Anaconda you should write this on your Jupyter notebook :
# Install a conda package in the current Jupyter kernel
import sys
!conda install --yes --prefix {sys.prefix} packagename
With a normal install of python you should write this on your Jupyter notebook :
# Install a pip package in the current Jupyter kernel
import sys
!{sys.executable} -m pip install packagename
By replacing packagename with the name of your package like numpy.
Cheers
Your Jupyter notebook server does not have access to internet. You operating system might have a firewall or limit internet access to third party applications, especially since this is a work laptop.
Regardless, it is easy to install components using pip. If you cannot access the internet from inside the notebook, try opening a Command Prompt as admin and simply type pip install iapws.
I tried installing OpenCV on Windows 10 using pip.
I used this command-
pip install opencv-contrib-python
After that when I tried importing cv2 on command prompt, it was successfully imported-
When I tried importing it on jupyter notebook, this error popped up-
This is the python version I'm using-
This is pip list and as I've highlighted, opencv-contrib-python version 3.4.3.18 is installed-
Then why can't I import OpenCV on jupyter notebook, like tensorflow or numpy are also in pip list and I'm able to import them both through command prompt and also on jupyter notebook.
Please help. Thanks a lot.
You have installed openCV in Python running on your Terminal, not into the working environment which Jupyter Notebooks is running from.
Whilst in Terminal write:
py -m pip install opencv-python
When you use pip list
You should see opencv-python 3.4.3.18
More information here.
In the Anaconda Navigator. Launch conda console as below.
In the console: run conda install opencv
Try this in anaconda prompt:
First create a new enviorment :
conda create -n opencv
then :
conda activate opencv
then:
conda install -c anaconda opencv
source:youtube
You should open the anaconda prompt and then type:
conda install opencv
It should work.
It seems like you run jupyter not from conda environment, that has opencv module installed.
try to do this:
conda activate <your environment>
conda install jupyter
jupyter notebook
after that try to "import cv2"