The Linux server is connected remotely and configured with pycharm and vscode (including jupyter notebook)

  • Linux new user tt

sudo adduser tt

adduser will actively call /etc/adduser.conf when creating a user;

When creating a user's home directory, it defaults to /home and is created as /home/username

  • Delete user tt

Remove along with all files owned by the user: sudo deluser --remove-all-files tt

  • View local users

getent passwd | grep '/home' | cut -d: -f1,6

  • Check graphics card usage

nvidia-smi

  • One graphics card is used by multiple people

nvidia-smi -i 0 -c DEFAULT

  • Download and installation of Miniconda3

  1. Download miniconda3

wget -c https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

  1. Run sh file

bash Miniconda3-latest-Linux-x86_64.sh

Note: Keep pressing Enter and enter yes, then continue to press Enter and enter yes.

  1. Reopen the shell file
  2. The installation is successful. The basic command of conda is as follows:

#Display conda version number

conda --version

#View environment

conda info --envs

#or

conda env list

#Configure bioconda and add Tsinghua source image

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda

conda config --set show_channel_urls yes

#View mirror source

conda config --show-sources

#Install the software to the specified folder

conda install --prefix=<path> <package name>

  • Configuration of pycharm remote connection:

Tools-->Deployment-->Configuration

The deployment path is where you upload the code

  • Configuration of jupyter notebook remote connection in pycharm:

The first is to install jupyter notebook on the server

How to remotely connect to jupyter notebook on linux server - Zhihu (zhihu.com)

Then just set it in pycharm:

File-->Settings-->Languages ​​and Frameworks-->Jupyter-->Jupyter Server

Problem: Jupyter notebook needs to reconnect to SSH every time and open it on the server before the remote connection can run normally. The solution is as follows -

Enter in the terminal: nohup jupyter notebook --allow-root &

However, the senior brother said:

  • vscode remote connection

Connecting to a remote server with vscode (fool-like teaching)-CSDN Blog

Guess you like

Origin blog.csdn.net/qq_46012097/article/details/134954275