Install and start using Jupyter notebook
1. Installation
Note : I did n't install Anaconda , and I felt that I needed the tool Jupyter notebook halfway, so I passed it in windowscmd command windowDownload, install and use.
*step1:*Switch path
(If you have not added the Python installation directory to Path, you need to switch to the Scripts directory of the Python installation directory) The details are as follows:
*step2:*Download
Enter pip install jupyter
and wait for the installation to complete~~~
Some may report an error, then switch to the domestic mirror download
pip install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple/
*step3:*Start Juypter Notebook
Enter in the command window: jupyter notebook The computer browser automatically opens the Jupyter Notebook window as follows, indicating that the installation is successful:
*step4:*Configure Jupyter Notebook
Enter in the CMD command window and jupyter notebook --generate-config
you can see that the user folder has a .jupyter file. Open the configuration file jupyter_notebook_config.py and
find the statement c.NotebookApp.notebook_dir = ' ', and modify it to c.NotebookApp.notebook_dir = 'store jupyter notebook The folder path of the code written in'
Note: delete the preceding #! ! !
If it has not yet taken effect, you can use a shortcut:
then right-click the shortcut button, modify the properties of the shortcut button, and change the starting location to the path location you need to store
step5 (optional): Add code auto-completion function
-
Enter pip install jupyter_contrib_nbextensions in the cmd command window, and wait for the installation to succeed~~~
If you encounter a timeout problem, switch to the domestic image download
pip install jupyter_contrib_nbextensions -i https://pypi.tuna.tsinghua.edu.cn/simple/
-
After installation, configure nbextension, enter jupyter contrib nbextension install --user --skip-running-check in cmd, and wait for the configuration to succeed~~~(Be careful to close the jupyter notebook first)
-
Then start jupyter notebook, click the option of Nbextension, and check Hinterland to add the code auto-completion function.
Visible success! ! !
Two, start
At this point, click the shortcut to directly enter the Jupyter Notebook window
3. Initial use
Click new to create a new file
Click run to execute step by step, and click the save button to save the file.
Jupyter notebook can also edit text