Use notebook notes (1), use notebook notes

Source: Internet
Author: User
Tags jupyter jupyter notebook

Use notebook notes (1), use notebook notes
1. Precautions for enabling remote access to notebook

 

After Ipython notebook is installed, you can enable the Service as follows:

ipython notebook --profile=nbserver --ip=XXX.XXX.XXX PS :
  • -- Profile = nbserver the value of this parameter can be written as an absolute path
  • The ipython command can also be replaced by jupyter.
2. When you remotely access ipython notebook, you still cannot enter the correct password;

In this case, we access it by carrying the token parameter,

PS: after all, people have already said: Token authentication is enabled. You need to open the notebook server with its first-time login token in the URL, or enable a password in order to gain access. The command: :
Therefore, we enter
jupyter notebook list
 
 
 

Therefore, assign a value to one of them and paste it into the address bar of the browser. Then, you can access it. As follows:

 

 

3. When I created a notebook in python notebook, I found that many third-party class libraries were unavailable (such as numpy)

 

Note: python in my local environment contains numpy and tensorflow, but it is thrown in notebook:

ImportError                               Traceback (most recent call last)<ipython-input-14-4ee716103900> in <module>()----> 1 import numpy as npImportError: No module named 'numpy'

 

You can find the problem by checking the information: ipython only loads the third-party Class Libraries under its own class library directory, and the class libraries installed in other places cannot be loaded.

Numpy cannot be found because the numpy class library cannot be automatically searched by python;

The solution is: manually add;

First, query the directory where the numpy third-party class library is located:

Enter:
Python

>>> Import numpy as np

>>> Print (np. _ file __)

The output is ('/usr/python/lib/python3.5/site-packages/numpy/_ init _. py ')

:

 

 

Now, we know the numpy installation path through the above commands;

Therefore, you can manually load the file to the system directory in the notebook, and enter the following in sequence:

Import OS

Import sys

Sys. path. append ('/usr/python/lib/python3.5/site-packages /')

 

:

 

 

 

 

PS:

After importing this path, not only numpy can be used, but other third-party libraries in this directory can also be used;

Paste the information you have queried here:

Http://stackoverflow.com/questions/15514593/importerror-no-module-named-when-trying-to-run-python-script/15622021#15622021

Http://stackoverflow.com/questions/26238004/ipython-notebook-throws-importerror-ipython-doesnt

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.