The installation and configuration path of jupyter notebook

download jupyter notebook

Here is mainly the installation process of pip under windows

First open the black window: win+r on the keyboard insert image description here
and enter in this window: cmd to enter the command line mode

At this time, you can download jupyter notebook,
but it is best to update your pip before downloading:
update command:
python -m pip install --upgrade pip
It is recommended that you update your pip before downloading, because it does not follow Various errors may appear in the new. (Personal test, before the update, I have been reporting various errors, and there is no error after the update. It is strongly recommended to update pip)

Then enter:
pip install notebook or pip install –user notebook
to download, but the default here is to download from abroad, and the speed may be a bit slow.

At this time, you can choose a domestic mirror source to download, for example: domestic
address source: pip install --user jupyter notebook -i http://pypi.doubanio.com/simple
In the above example, I used Douban source, of course you can also Can be downloaded from other sources

However, these sources may sometimes report an error and cannot find the corresponding version. This is because there is no corresponding jupyter or notebook version under the mirror source. You can try to replace other mirror sources. If it still doesn’t work after replacing several mirror sources, then use: pip install notebook or pip install –user notebook to download from the official website.

When you finish downloading, happily enter: jupyter notebook to start the service at the window command line, an accident happens again:
insert image description here
this is because your jupyter notebook has not configured environment variables, here are two ways to solve this Question:
First enter on the command line: pip list to check the library you installed
insert image description here

Make sure you have installed the jupyter and notebook libraries
and then enter: pip show jupyter notebook
This will print out the relevant information of these two libraries, find the storage location of the library:
insert image description here
copy the location of one of them, and then open this computer on the desktop, Paste it into the file path bar and press Enter to find the installation location of the library.
insert image description here
Then return to the upper level directory:
insert image description here
the black box here is the upper level directory of the library path,
the Scripts in the red box is the same level directory as site-packages, what we are looking for is the Scripts folder, click to enter Scripts
insert image description here
Method 1: Look at the blue box here, it is an .exe executable file, click this file directly to start jupyter notebook.
The disadvantage of this method is that every time you want to open your jupyter notebook, you need to find the location of this file, and then click to open.
Method 2: Copy the path in the red box in the above figure,
then find your environment variable, and click OK (don’t ask for the black box)
(The way to find the environment variable here, you can use Baidu yourself, I’m lazy and don’t write it here)
insert image description here
Find Click on the path in the figure below, it turns blue, and then click Edit
insert image description here

Then click New and copy the path into the newly created box
insert image description here

Don’t forget to click OK in the black box after you’re done.
At this time, reopen the command line window and enter: jupyter notebook again.
insert image description here

Tips for using jupyter notebook

1. Because the default code storage workspace after installing the notebook is on the C drive, if you want to change the code storage path, you can do the following: jupyter notebook --generate-config command to view the directory where the notebook configuration file is located Open the
file
jupyter_notebook_config .py, modify the default storage path
Find the line c.NotebookApp.notebook_dir = r'F:\notebook', delete the '#' in front of this line, and change it to the path you want.

2. Commonly used shortcut keys:

operate Order
Cell type conversion Y 、M
insert cell A、B
enter command mode Esc
code completion Tab
run cell ctrl / shift / alt + enter
delete cell DD

end

I have installed jupyter notebook before, but now I want to use jupyter notebook. After more than an hour of installation, it was finally done. I regret that I didn't write the installation process when I installed it before, which caused a lot of time wasted when I installed it now. I hope this article can help you when you install jupyter notebook. If this article can help you, please give a like to support it.

Guess you like

Origin blog.csdn.net/m0_59151709/article/details/130769026