1. Build the Anaconda environment on the server
1. Download Anaconda:
Download the required Anaconda version from Tsinghua source address to your computer. (The speed of the official website is slow and not recommended.)
I chose Anaconda3-2019.10-Linux-x86_64.sh
2. Upload Anaconda:
First, open the terminal with the downloaded installation package (the file name is Anaconda3-2019.10-Linux-x86_64.sh), Use the scp command to copy the installation package to the remote server, and then enter the password according to the prompt.
cd ~/文件路径
scp Anaconda3-2019.10-Linux-x86_64.sh username@远程服务器IP:/home/username
Or log in to the remote account first, and then directly download the anaconda installation package to the remote server:
cd /home/username
wget https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
Or upload directly from the downloaded folder to the location to be installed through WinS CP:
3. Install Anaconda:
log in to the remote account in the terminal, enter cd /home/username, and then enter ls, you can see that there are copied files in the list Install the package Anaconda3-2019.10-Linux-x86_64.sh.
In Linux, the .sh file is an executable script file, which needs to be installed with the command bash.
Enter in the current file directory:
bash Anaconda3-2019.10-Linux-x86_64.sh
Keep pressing Enter or type yes to continue and accept the license terms.
4. Check whether the installation is successful:
reopen the terminal, and log in to the remote account with ssh to take effect.
Check whether Anaconda is successfully installed Enter: python
2. Install the tensorflow environment in Anaconda:
1. Create a Python environment:
first enter the base environment. Generally, after Anaconda is built, it will enter the base environment and create an environment corresponding to the python3.6 version (if it already exists, it will be overwritten, or a new environment can be created, such as my Created for tensorflow1.14 ):
conda create -n tensorflow1.14 python=3.6
2. Enter the created Pytorch environment:
Enter the pytorch environment (created by yourself):
conda activate tensorflow1.14
or source activate tensorflow1.14
3. Use: pip/conda install + full file name to install tensorflow:
Take mine as an example:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow==1.14.0
Check with command:conda list
The installation is successful as shown in the figure: