Install the Anaconda environment based on Python3.7 under Linux

Anaconda is a very huge python resource library for science. In view of the wide application of python in AI, Anaconda provides a lot of AI open source libraries for python , Which allows data scientists to regularly deploy AI and machine learning projects to production on a large scale, quickly passing insights to decision makers

The following describes the installation of Anaconda environment under Linux

1. Create a user

We generally install the Anaconda environment under ordinary users, so that users can use their own python interpreter independently, and can install various python resource libraries without root permissions

# Create a user under root privileges, xxx is your username
useradd -s /bin/bash -d /home/xxx -m xxx
# set password
passwd xxx
# Switch user
su xxx

2. Download Anaconda offline resource package

Official link: https:// www.anaconda.com/distribution/

# In the terminal environment, use the wget command to download
wget -c -t 20 https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
# In the terminal environment, use wget command to download in the background
wget -bc -t 20 https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh
# Download in the background, check the download progress
tail -f wget-log
# Add executable permissions
chmod +x Anaconda3-2020.02-Linux-x86_64.sh

3. Install Anaconda environment

# Execute directly in the terminal, make sure your computer has a network
./Anaconda3-2020.02-Linux-x86_64.sh

Next you just need to wait for the installation to complete, the installation interface is as follows:



Complete the installation:

4. Configure environment variables

# Configure environment variables, edit bashrc file
vi ~/.bashrc

Delete the following initialization part:

Add the following content to the bashrc file, where xxx is your user name, save and exit:

export PATH="/home/xxx/anaconda3/bin:$PATH"
export LD_LIBRARY_PATH="/home/xxx/anaconda3/lib:$LD_LIBRARY_PATH"

Update environment variables:

source ~/.bashrc

5. Test

conda --version

Output:

0

Leave a Reply

Your email address will not be published.