Python Virtual Environment Setup
- Download the Anaconda installation script.
- Download and run the script on the x86 server.
1 2
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2.1.0-Linux-x86_64.sh sh Anaconda3-2.1.0-Linux-x86_64.sh
- Download and run the script on the Arm server.
1 2
wget https://github.com/Archiconda/build-tools/releases/download/0.2.3/Archiconda3-0.2.3-Linux-aarch64.sh sh Archiconda3-0.2.3-Linux-aarch64.sh
- Download and run the script on the x86 server.
- Install Anaconda.
- Execute the Archiconda3-0.2.3-Linux-aarch64.sh file.
sh Archiconda3-0.2.3-Linux-aarch64.sh

- Enter yes to accept the agreement.

- Enter the Anaconda installation directory or press Enter to install Anaconda in the default directory /root/archiconda3. In this example, the installation directory defaults to /root/archiconda3.

- Enter yes to create the environment variable.

- Update the environment variable.
1source .bash_profile
- Execute the Archiconda3-0.2.3-Linux-aarch64.sh file.
- Establish a Python virtual environment.
- Create a Python virtual environment on the x86 server.
1conda create -n mlpy_env --copy -y -q python=2
- Create a Python virtual environment on the Arm server.
1conda create -n mlpy_env_aarch64 --copy -y -q python=2
After the creation is completed, a virtual environment folder is generated in the envs directory of the Anaconda installation directory. For example, if Anaconda is installed in the default directory, a virtual environment folder is generated in the /root/archiconda3/envs directory.
- Create a Python virtual environment on the x86 server.
- Create a Python virtual environment package for both the x86 and Arm servers.
- Copy the mlpy_env and mlpy_env_aarch64 directories in the envs directory of the Archiconda installation directory on both the x86 and Arm servers to the same directory, for example, /home, of any server.
- Compress the mlpy_env and mlpy_env_aarch64 directories into a ZIP package.
1 2
cd /home zip -r mlpy_env.zip mlpy_env mlpy_env_aarch64
The mlpy_env.zip package is the Python package that can be run on both x86 and Arm servers.
- Upload mlpy_env.zip to the /opt directory on the task submitting host in the cluster.
Parent topic: Usage (Anaconda as an Example)