In this tutorial, you will install and configure ** Anaconda ** on Alibaba Cloud Elastic Compute Service (** ECS **) with Ubuntu 16.04 installed.
--You need to enable Alibaba Cloud Elastic Compute Service (ECS) to see the valid payment methods. If you are a new user, you can earn Alibaba Cloud credits $ 300- $ 1200 worth for your new account. If you don't know how to set up an ECS instance, click here (https://www.alibabacloud.com/blog/3-ways-to-set-up-a-linux-server-on-alibaba-cloud_572384?spm= See the tutorial on a2c65.11461447.0.0.3eca2221jemyAq) or the Quick Start Guide (https://www.alibabacloud.com/help/en/doc-detail/25422.htm). The ECS instance must have at least 1GB of RAM and a 1-core processor. --At least 3GB of free disk space is required to install Anaconda Python. --Domain name registered from Alibaba Cloud. If you have already registered your domain from Alibaba Cloud or another host, you can update the record for that Domain Name (https://www.alibabacloud.com/en/domain) server. --The domain name must point to your Alibaba Cloud ECS IP address. -Access the SSH client installed on Alibaba Cloud's VNC console or PC. --Set the host name of the server and create a user with root privileges.
Please update your Ubuntu system with the following command before proceeding with the package installation. Remember to log in with sudo privileges as a non-root user to run this command.
# sudo apt update && sudo apt upgrade
We recommend using the Anaconda installer bash script to download and install Anaconda Python. The bash script will automatically install the required libraries and packages for you. To do this, you need to follow the steps below.
After installing Anaconda Python, you no longer need the Anaconda installer bash script, so change to the directory ** / tmp **.
# cd /tmp
To get the latest version of the Anaconda Python installer, go to the official Anaconda Python website [https://www.anaconda.com/download/#linux](https://www.anaconda.com/download?spm=a2c65. See 11461447.0.0.3eca2221YWFOAp # linux.). Run the following command to get the bash script for the Anaconda Python installer.
# curl -O https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
Run the following command to see if the file was downloaded successfully. Also, make a note of the file name for use in the checksum in the next step.
# ls -li
You need to verify the integrity of the installation data. To do this, you must use SHA-256 checksum cryptographic hash validation. To do this, you need to run the ** sha256sum ** command and use the ** Anaconda3-5.2.0-Linux-x86_64.sh ** filename. In your case, the file name may be different due to different versions of Anaconda Python.
# sha256sum Anaconda3-5.2.0-Linux-x86_64.sh
You should see output similar to the following.
09f53738b0cd3bb96f5b1bac488e5528df9906be2480fe61df40e0e0d19e3d48 Anaconda3-5.2.0-Linux-x86_64.sh
You can see the outs by comparing the available hashes on the Anaconda Python page. http://docs.continuum.io/anaconda/install/hashes/
You need to run a bash script.
# bash Anaconda3-5.2.0-Linux-x86_64.sh
You will be asked to confirm the license agreement. Press ** Enter ** to continue.
Press and hold ** Enter ** until you see ** Please answer'yes' or'no' **. Type ** yes ** and press ** Enter **.
You will be prompted to confirm the installation location. Press ** Enter **.
You will be prompted to confirm that you want to prepend the installation to your PATH. Type ** yes ** and press ** Enter **.
The following screen will be displayed. You will be prompted to install Microsoft Visual Studio. Type ** yes ** and press ** Enter ** to continue.
This completes the installation of Anaconda Python. To enable the installation, you need to source the files with the following command.
# source ~/.bashrc
You can confirm the installation by executing the following command.
# conda list
You can keep projects in Anaconda virtual environment by organizing projects in Anaconda virtual environment by Python version and package. You can specify a Python version for each Anaconda environment and keep related programming files in that directory. You can check the available Python version by running the following command.
# conda search "^python$"
You need to create an environment. This can be achieved by using the latest version of Python 3. This can be achieved by assigning version 3 to Python. To assign a version, run the following command:
# conda create --name aareez python=3
Don't forget to replace ** aareez ** with the desired environment name.
If you want to target a specific version, you can use the command by specifying the version number as shown below.
# conda create --name aareez python=3.7.0
When I run the above command, I get a message similar to the following, asking for permission to install the new package. Type ** y ** and press ** Enter **.
After creating the environment and installing the required packages, you will see a screen with commands to enable or disable the created environment.
The following required default packages are installed in each created environment.
1、zlib 2、xz 3、tk 4、wheel 5、setuptools 6、sqlite 7、python 8、readline 9、openssl 10、pip You can also add packages as needed. For example, if you want to install numpy, you need to install the following command.
# conda install --name aareez numpy
The following screen will appear asking if you want to allow the installation of the required packages. Type ** y ** and press ** Enter **.
You can enable the environment by executing the following command.
# source activate aareez
If you want to install ** r-acepack ** in your current environment, you can install it after starting the environment by executing the following command.
# conda install -c r r-acepack
The following screen will appear asking if you want to allow the installation of the required packages. Type ** y ** and press ** Enter **.
You can disable the environment with the following command.
# source deactivate
You can check the Python version in your environment with the following command.
# python --version
You can also update the version of conda by executing the following command in the environment.
# conda update python
You can also check the available environment by executing the following command. When you run the command, a list of environments will be displayed.
# conda info --envs
An asterisk (*) indicates the environment that is currently running.
If you want to install any package while creating the environment, you can use the following command to create the environment.
# conda create --name aareez python=3 numpy
When you are finished working in one environment and no longer need to work in a particular environment, you can delete it using the following command:
# conda remove --name aareez ¨Call
A screen similar to the one below will be displayed, asking if you want to allow the removal of other installed packages. Type ** y ** and press ** Enter ** to successfully remove the environment named ** aareez **.
To check, you can check the list of available environments again with the following command.
# conda info --envs
You need to keep Anaconda up to date in order to get the latest packages. To do this, run the following command.
# conda update conda
You will be asked if you want to allow the package update. Type ** y ** and press ** Enter **.
Then run the following command to update Anaconda.
# conda update Anaconda
This will ensure that you are using the latest version of Anaconda.
You will be asked for permission to allow the package update. Type ** y ** and press ** Enter **.
Congratulations. You have successfully installed Anaconda Python on your Alibaba Cloud Elastic Compute Service (ECS) instance.
Recommended Posts