how start and install with jupyterlab notebook? - python

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.

Related

Issue with Jupyter notebook and virtual environment pip

I have created a virtual environment using the following commands:
python3 -m venv venv
.\venv\Scripts\activate.bat
pip3 install ipykernel
pip3 install jupyter
python3 -m ipykernel install --user --name=venv
I have created a Jupyter notebook using the venv that I created, but when I install a package in the virtual environment, it is not recognised in the notebook.
For example, I tried to install pandas using pip3 install pandas, but when I try and import it into my notebook I get the error ModuleNotFoundError: No module named 'pandas'
The module has installed in the right place venv\Lib\site-packages\pandas\
Any ideas on what I should do?
EDIT:
I noticed that even though I created the notebook using the venv, it uses the normal python environment rather than the virtual one. Ideas on how to fix this?
Well I think I solved it. If ran the following command:
python -c "import IPython"
Which just installs IPython in my venv.
You need to restart the notebook kernel, it will probably work then.
In the future, in a notebook cell you can run
%%bash
pip install pandas
then you should be able to continue without restarting

About installing rasterframes module in Python

I successfully installed pyrasterframes with pip in cmd, but when I try to import it in jupyter notebook I get the following error: "No module named 'pyrasterframes'". Could you help me please?
This issue solved by removing your specific environment from jupyter by the following instruction:
"jupyter kernelspec uninstall envname"
and then installing ipykernel and readding the environment to jupyter notebooks as following:
"conda install -c anaconda ipykernel"
"ipython kernel install --user --name=envname"
notice that I should open jupyter notebooks after activating my env in cmd.
I think you can use this solution to solve similar installation problems with any other modules.

Exception: Jupyter command `jupyter-notebook` not found, windows

So after installing VSCode and Python 3.7.4 (64 bit) I really struggle to make the "python interactive" work.
I have installed the Python extension in VScode, also jupyter and jupyter-lab but I keep getting the error "Exception: Jupyter command jupyter-notebook not found." when I try to run a cell/a line.
I am running Windows 10, using pip3
What did the trick was, that a few packages were outdated.
Firstly I had to uninstall pyzmq and install it again.
Then I ran pip3 install --upgrade nbconvert.
I also did pip install --upgrade pywin32==224 but I think the upper two solved the problem.
Lesson learned: Never use conda/pip together!
I believe you have to install anaconda first and start your notebook from an anaconda terminal.

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