change python version in jupyter notebook - python

I am using jupyter notebook and jupyter lab through jupyter hub.
Currently, the python version recognized by jupyter is 3.6.8.
I want to set the python version to 3.7.3.
The python version installed on the server is as follows. (/usr/bin/python*)
The jupyter notebook kernel is set as follows in /usr/local/share/jupyter/kernels/python3/kernel.json
If you change the argv path to '/usr/bin/python3' or '/usr/bin/python3.7', the kernel is busy and the connection is not made. TT
It works well only when argv path is '/usr/bin/python 3.6'.
Setting Code
sudo apt-get install python3-pip
sudo pip3 install ipykernel
sudo jupyter kernelspec install-self

as this post says, you need to create a new kernel and this website shows how to do it

I solved it by reinstalling the below packages. thank you.
pip3 install tornado==5.1.1
pip3 install notebook==5.7.4```

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

how start and install with jupyterlab notebook?

I want to start working by jupyter notebook. I am using Mac. I did the following commands in terminal.
pip install jupyterlab
pip install notebook
They were installed well now in terminal I type :
jupyter notebook
And get :
-bash: jupyter: command not found
try anaconda, the best and easiest way to use jupyter notebook
Try this:
pip install --upgrade notebook
Then run
jupyter notebook
In case, you may have some python version inconsistency, always install PiPy packages with this command:
python -m pip install jupyter
Most of time, this type of installation, resolve many issues.
If your issue not solved, refer to this question, this is about your similar problem with Jupyter in Windows.

Install python packages on Jupyter Notebook

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.

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"

Categories

Resources