[Python] Installation and configuration of Jupyter in Windows environment

>Jupyter

Jupyter is a WEB program that provides a Matlab-like documented input and output process.


>installation

Its predecessor is IPython, and it belongs to SciPy.org along with Numpy, and this thing is closely related to numerical operations, so you might as well download all the packages of the organization:

pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
The default installation address with pip is:

C:\Users\username\AppData\Roaming\Python\Python27\site-packages # Notice: My machine is Python2.7
You can delete it at any time when you don't need it.


>Environment Configuration

First of all, if you use pip to download and install from the default address like me, then open C:\Users\a\AppData\Roaming\Python\Scripts after installation, you will find a bunch of exe starting with jupyter here document:


Of course, in order to facilitate startup, we can add this folder to the environment variable at this time. The specific operation is to add C:\Users\username\AppData\Roaming\Python\Scripts to the environment variable path.

Then restart cmd, you can start Jupyter Notebook directly with cmd by typing the following command:

jupyter notebook

But don't worry, in order to use the notebook more conveniently, we need to do some configuration.


>Configure

Use cmd to type the command:

jupyter notebook --generate-config
Then go to C:\Users\username\.jupyter to find the jupyter_notebook_config.py file, open it, and modify the command around line 214 as follows:


The gray text part is the save location (project location) of the code written in Jupyter Notebook in the future. This folder needs to be created manually in advance .

Finally, open cmd and start the notebook with the following command:

jupyter notebook

>Test (*Note that some browsers may not display the page, please try to open with IE or chrome)

Create a "project" as shown below:


If you have scikit-learn installed , then testing the official sample code will get the following results (the image needs to be expanded with shift+enter):




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325644691&siteId=291194637