Rate This Document
Findability
Accuracy
Completeness
Readability

Python Virtual Environment Setup

  1. 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
      
  2. Install Anaconda.
    1. Execute the Archiconda3-0.2.3-Linux-aarch64.sh file.
      sh Archiconda3-0.2.3-Linux-aarch64.sh

    2. Enter yes to accept the agreement.

    3. 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.

    4. Enter yes to create the environment variable.

    5. Update the environment variable.
      1
      source .bash_profile
      
  3. Establish a Python virtual environment.
    1. Create a Python virtual environment on the x86 server.
      1
      conda create -n mlpy_env --copy -y -q python=2
      
    2. Create a Python virtual environment on the Arm server.
      1
      conda 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.

  4. Create a Python virtual environment package for both the x86 and Arm servers.
    1. 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.
    2. 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.

    3. Upload mlpy_env.zip to the /opt directory on the task submitting host in the cluster.