Jupyter notebook will not open from command prompt
Asked Answered
M

6

4

I am trying to work with Jupyter notebook on Windows 10 (64-bit). I downloaded Anaconda3 5.0.1. Now I should be able to open the jupyter notebook from the command prompt by typing jupyter notebook. However I get the following error:

enter image description here

The only way I am able to open jupyter notebook is from the Anaconda navigator. However, I would like to change the directory from which the notebook opens and none of the solutions here How to change the Jupyter start-up folder work if I cannot open jupyther from the command prompt. I have already tried uninstalling and reinstalling anaconda, but that did not change anything.

Mi answered 15/11, 2017 at 22:1 Comment(0)
T
6

This error is because you didn't set environment after installing Anaconda. Go through following steps to solve this issue

  1. Search in start "Edit the system environment variable" and open it.
  2. Click environment variables button
  3. Go to there and add 2 directory path where you installed Anaconda

      i.e. 1. C:\ProgramData\Anaconda3 
           2. C:\ProgramData\Anaconda3\Scripts 
    

Hope this will solve your error :)

Talanta answered 5/1, 2018 at 13:30 Comment(1)
Hi. I installed python directly (not anaconda). And then ran pip jupyter to install jupyter. Now pip commands work in cmd, python --version works in cmd, but jupyter-notebook doesn't work. Same error as in question. pip list shows all jupyter modules already installed. And reinstalling python or jupyter doesn't solve the issue. PATH is already configured during python installation by checking that checkbox. And in the system env python installation path is already mentioned. What should I do now?Warranty
U
2

As everyone else said, adding the path should work. But often, the script folder may be something like:

<Username>\AppData\Roaming\Python\Python311\Scripts 

instead of the usual script folder for Python. So do check that. If necessary, install something else using pip to find the folder.

Unjust answered 28/9, 2023 at 6:0 Comment(0)
B
1

If you have:

  • Jupiter installed directly from Python (not anaconda)
  • PATH already configured (in case of not, you can do it manually from Windows system advanced menu)

try with: py -m jupyter notebook

It should work ;)

Brod answered 25/4, 2022 at 21:14 Comment(0)
D
0

Here is a solution that worked perfectly for me (on windows 10):

1.click start

2.Click on the Search box

3.Search for 'Edit the system environment variable'

4.Click environment variables button

5.Click on the variable 'Path' (in user variables list not system variables)

6.Now click on the 'Edit' button beneath the user variables list

7.Click the 'New' button

8.Now type the location where you saved the app (anaconda) folder, in my case, I used the default folder which was (C:\Users\'myUsername'\anaconda3\Scripts).

After those steps I restarted my laptop and it worked perfectly.

It should work for you too ;)

Dendrochronology answered 26/3, 2023 at 20:56 Comment(0)
U
0

I used Flavio Cacchioni's solution in combination with Divine John's. When I installed pip it showed a warning (yellow text) that some scripts (maybe all of them) were not on a path. So there is a directory in those yellow texts, and I just copied them and pasted them to Divine john's step no. 8. Pressed ok, restart, then voila!

This solution works if it's the actual python (not anaconda), otherwise, refer to Rahul Vansh.

Do update your jupyter >>pip install -U jupyter

Unvoiced answered 29/5, 2023 at 14:44 Comment(0)
F
0

If you type jupyter lab into the command prompt, it may work.

Fiske answered 4/3 at 19:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.