"Python in Action" 2-Cannot start Jupyter Notebook from the command line

Detailed description of the problem:

After installing Anaconda, Jupter Notebook cannot be started via the command line. The command line shows:'jupter' is not an internal or external command, nor is it an executable program or batch file.

Related problem description:

Cannot start Jupyter Note or Jupyter Lab from the command line.

Key words:

Command line, Jupyter Notebook, Jupyter Lab, environment variables

solution:

In the article "Learning Python with You Hand in Hand" 5-Jupyter Notebook , we introduced the installation and use of Jupyter Notebook. After installing Anaconda, Jupyter Notebook is already installed by default, so in most cases, you can start it as long as you follow the above method.

However, some friends responded that when starting Jupyter Notebook using the command line for the first time, the words "'jupter' is not an internal or external command, nor a runnable program or batch file." appear on the command line, causing the startup to fail.

Let's learn a simple method-configure "environment variables", which can easily solve the problem of not being able to start Jupyter Notebook through the command line.

1. Open the environment variable dialog box

Right-click "My Computer" and click Properties -> Advanced System Settings -> Advanced -> Environment Variables to display the "Environment Variables" dialog box.

2. Open the system variable Path

There are two Paths in the environment variable dialog. The upper part is the user variable Path, and the lower part of the system variable Path is the object we want to edit. Double-click or click the "Edit" button to edit the environment variable.

3. Edit environment variables

After opening the edit environment variable dialog box, click the "New" button at the upper right, and enter three Anaconda directory paths in turn (click the "New" button for each addition).

The three directory paths of Anaconda, which can be found in the directory where we installed Anaconda, are:

C:\Users\"User Name"\anaconda3

C:\Users\"User Name"\anaconda3\Scripts

C:\Users\"User Name"\anaconda3\Library\bin

If Anaconda is installed according to the default path, replace the "user name" in the above three paths with the user name of your computer. If not, find the installation path and copy the paths of the above three folders (anaconda3, anaconda3\Scripts, anaconda3\Library\bin) to the newly created environment variable.

The final effect is the same as in the second picture below, and then click OK all the way to complete the entire configuration process.

4. Start Jupyter Notebook

After the configuration is complete, we can start Jupyter Note through the command line.

5. Start Jupyter Lab

If you enter Jupyter Lab on the command line, you can also start a new generation of Jupyter Lab, which not only contains all the functions of Jupyter Notebook, but is more powerful.

  • The above is a solution to the inability to start Jupyter Notebook through the command line. If there are other solutions, or the situation still cannot be started after using the above methods, please leave a message to discuss.

 

 


Thanks for reading this article! If you have any questions, please leave a message and discuss together ^_^

Welcome to scan the QR code below, follow the "Yesu Python" official account, and read the other articles in the "Python in practice" series.

Also talk about Python-a learning and sharing area for Python lovers

Guess you like

Origin blog.csdn.net/mnpy2019/article/details/110679492