Configuration server (anaconda + jupyter + R)

To sum up the whole process:

1. Server installation anaconda

  First Tsinghua mirror sites to download anaconda3.

2. The downloaded file incoming server with scp command

  Note: -P specify a port with a capital p command

1  SSH -P 65532 local address username @ server IP: transmission destination address

  If you want to transfer a folder please use the following command:

1  SSH -P 65532 -r native address username @ server IP: transmission destination address

3. Install

1 bash AnaXXXX.sh

If you need to reinstall your use

1 bash AnanXXX.sh -u

Here encountered a pit, is a node server is broken, so to enter into another node

1  SSH -p 65532 [email protected]    // this node is broken, they wanted to go to reassign node 
2  SSH g03     // specified node into the g03    

 

4. After installed before they can use to configure the path

Input command to open profile
vim ~ / .bashrc

In the last sentence add
export PATH = / home / XXX / anaconda3 / bin: $ PATH

XXX is your username

note

linux profile execution order:
/ etc / Profile → (~ / .bash_profile | ~ / .bash_login | ~ / .profile) → ~ / .bashrc → / etc / bashrc → ~ / .bash_logout

If there is no code in the following ~ / .bash_profile file:

1 if [ -f ~/.bashrc ] ; then
2         source .bashrc
3 fi 

Then linux will not automatically execute ~ / .bashrc file, so every time you log must manually enter the source ~ / .bashrc.
So it is necessary vim ~ / .bash_profile add content code block, of course, if you took the trouble to every source of it!

After the source you can see the python can display the corresponding version of the anaconda installation

conda can also be used

First build environment:

1 Conda Conda Base Update -n         // Update the latest version of Conda 
2 Conda the Create -n Python xxxx = 3.5    // create a virtual environment python3.5 of xxxx 
3 Conda of an activate xxxx                // open environment xxxx 
4 Conda deactivate                   // close the Environment 
5 Conda env List                     // display all of the virtual environment

5. jupyter configure remote link

I personally do not recommend the online operation with common configuration password, because if not configured, will open jupyter each assigned a token to copy this code on it

jupyter can also specify a port

1 jupyter notebook --port 9995

Then establish a tunnel in the machine's 9995 port listening remote server, you can access in your browser

Tunneling:

1 ssh -p 65532 xxx@xx.xxx.xx.xxx -L 127.0.0.1:9995:localhost:9995

127.0.0.1 is specified for the preceding node enters g03, if the node is not started directly broken by the following

1 ssh -p 65532 [email protected] -L 9995:localhost:9995

 6. jupyter associated R

R installed in a built environment of anaconda below, it is recommended to replace the source of Tsinghua University

 1 #加源与库
 2   conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
 3     conda config --set show_channel_urls yes
 4 
 5 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
 6 
 7 conda config --add channels conda-forge
 8 conda config --add channels defaults
 9 conda config --add channels r
10 conda config --add channels bioconda
11 
12 #升级conda版本
13 conda update conda
14 conda install R

Then, start the R console, run the following statement ::

1 install.packages(c('repr', 'IRdisplay', 'crayon', 'pbdZMQ', 'devtools'))
2 devtools::install_github('IRkernel/IRkernel')
3 IRkernel::installspec()  # to register the kernel in the current R installation

Then restart it jupyter

Guess you like

Origin www.cnblogs.com/shanyr/p/11276755.html