How to choose which jupyter notebook to run? - python

I have installed jupyter notebook for Python 3 (installed through pip) and for Python 2 (installed through anaconda stack which included scipy and scikit-learn and similar scientific tools).
When I run jupyter notebook in console it opens but I can choose only Python 2 kernel.

In terminal try inputting this:
python3 -m pip install ipykernel
and this:
python3 -m ipykernel install --user
Then restart jupyter and anaconda and you should be able to select the other kernel version.

Related

Installing jupyter notebook shows command not found

Im trying to install jupyter notebook but when I run jupyter/jupyter-notebook/jupyter notebook It shows command not found. I'm using python 3.7 and have tried all commands like :
pip install jupyter
pip3 install jupyter
python -m pip install jupter notebook
pip install --user jupyter
sudo pip install jupyter
enter image description here
It shows an exception error I don't know why?
Are you using cmd to install?
If yes, then you want to install the classic Jupyter Notebook using:
pip install notebook
Then, you can run with:
jupyter notebook
jupyter-notebook
py -m jupyter notebook
py -m jupyter-notebook
python -m jupyter notebook
python -m jupyter-notebook
That works fine for me. Tell me if you still have problems.

How to have a jupyter notebook use the correct kernel?

On a MacOS Mojave I am trying to run a jupyter notebook with a python 3.7 kernel. Following this instructions I did the following:
virtualenv -p pythpn3.7 venv3.7
source venv3.7/bin/activate
pip install jupyter
ipython kernel install --name "venv3.7" --user
I then start a notebook
jupyter notebook some_notebook.ipynb
and I select the kernel venv3.7, but when I do a python -V I get an answer python 3.6.9 instead of python 3.7.6. And when I do a
!which python
inside the notebook I get the wrong answer
/Users/me/.pyenv/versions/3.6.9/bin/python
So how to get a python 3.7 kernel inside a jupyter notebook?
The instructions shown in this page are wrong!
The correct way to do this is:
python -m ipykernel install --user --name=venv3.7

Import OpenCV on jupyter notebook

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"

Problem with Python Version And Jupyter Notebook

So I created a python 2.7 env "gdsenv" using anaconda:
Then I installed the jupyter kernel:
...so far it seems good.
The problem is that if I open jupyter-notebook, I don't get python 2.7 option (I have python 3.5 installed on another env):
Why is that and how can I fix that ?
See if you can install an ipython kernel for python2.
I don't have anaconda installed, but here's how it works for a virtual environment created with python2 -m virtualenv jupyter-test:
Install jupyter:
python2 -m pip install jupyter
Install ipython kernel for python2:
python2 -m pip install ipykernel
python2 -m ipykernel install --user
Start jupyter not[![ebook
jupyter notebook][1]][1]
You should now be able to create a python2 kernel:
See also this question which seems related:
Using both Python 2.x and Python 3.x in IPython Notebook .

conda environment doesn't launch jupyter or recognize pip

I created a conda environment (with python 3.6 and Anaconda 3-5.2.0 on a Windows 10 machine) and activated it. I then installed both jupyter and pip using conda install jupyter and conda install pip. Both commands executed without problems.
When I type jupyter notebook or pip install [some package] I get this:
The same happens for the pip command. What might be the cause of this issue?

Categories

Resources