How to configure the link between python installation (Anaconda) and ipython remote server in linux, anacondaipython
Basic installation steps:
1. Download Software
Wget
2. install it. Always enter or yes.
Bash Anaconda3-5.0.1-Linux-x86_64.sh
3. Input python to check whether the installation is successful.
If there are different python versions, uninstall them, or directly install the/. bashrc directory in source.
Python
4. Generate a configuration file
Jupyter notebook-generate-config
Note: In earlier versions of python2, use the command ipython profile create myserver to generate three files containing ipython_notebook_config.py (including directories. If some files do not exist, you can create them yourself)
Vim/root/. ipython/profile_myserver/ipython_notebook_config.py
5. Generate a password
Directly enter the command ipython, open ipython, and create a ciphertext password:
In [1]: from notebook. auth import passwd
In [2]: passwd ()
Enter password:
Verify password:
Sha1: 8d628fff7b12: 274eca57...
Copy the generated ciphertext
6. Modify the default configuration file
Vim path/jupyter_notebook_config.py
Or (py2)
Vim path/ipython_notebook_config.py
Make the following changes:
C. NotebookApp. ip = '*'
C. NotebookApp. password = 'sha: ce... The ciphertext copied just now'
C. NotebookApp. open_browser = False
C. NotebookApp. port = 8541 # specify a port
7. Start jupyter notebook
Jupyter notebook (ipython notebook can also be used in python2, which is not recommended)
Or (if you do not modify the default configuration, you can only call the self-created configuration)
Jupyter notebook-config =/home/dgbd/. jupyter/jupyter_notebook_config.py
After the jupyter notebook service is started, open the browser on a remote PC (or Server Browser) and enter the IP address and port number to connect.
Note: It is not recommended to start with the root user. If you need to start with the root user, add-allow-root.
Jupyter notebook-allow-root-config = configuration file path
Possible problems:
8. Open firewall ports
After jupyter notebook is started, open a browser on the VM to access ipython jupyter. However, if the connection is remote, it is generally caused by a firewall.
Use root User
Open Port 8541
Sudo/sbin/iptables-I INPUT-p tcp-dport 8541-j ACCEPT
Save
Sudo/etc/rc. d/init. d/iptables save
Restart service
Sudo service iptables restart
9. Sometimes you need to create a self-signed certificate
Some other operations:
Since anaconda is installed in a folder/root/anaconda in linux, it is convenient to delete anaconda if an error occurs during installation or you want to update another version. Run the following command:
Rm-rf ~ /Anaconda
View the packages below anaconda:
Conda list
Uninstall an installed package
Pip uninstall XXX
Install a package (if the path is not included with the environment variable, the above command is also used)
Pip install
Install anaconda-navigator
Conda install anaconda-navigator
Anaconda-navigator