logo Mr.Robota 具身智能学习手册 中文
Chapter 11: Other auxiliary tools

You can tell Conda: “Please also treat /root/gpufree-data/envs as a storage location for the environment.” In this way, you can create and activate the environment directly using the name, while the files are actually stored on the data disk.

Operation steps:

  1. Add the path to Conda configuration:

    bash# 将数据盘目录添加到环境搜索路径的“最前面”
    conda config --add envs_dirs /root/gpufree-data/envs
    
  2. Verify configuration:

    bashconda info
    # 检查输出中的 "envs directories"
    # 确保 /root/gpufree-data/envs 排在第一位
    
  3. Use the name to create an environment as usual: Since the data disk path is at the first position, Conda will automatically create the new environment there by default.

    bashconda create -n openpi-server python=3.11 -y
    
  4. Activate with the name as usual:

    bashconda activate openpi-server
    

In this way, both the storage space problem (actually on the data disk) is solved, and the concise command experience is maintained.


Method 2: Setting Shell Alias (Alias)

If you do not want to modify the Conda configuration, you can add a alias in ~/.bashrc:

  1. Edit .bashrc:
    bashecho 'alias act_openpi="conda activate /root/gpufree-data/envs/openpi-server"' >> ~/.bashrc
    source ~/.bashrc
    
  2. In the future, simply enter act_openpi to activate it.

Summary: Method 1 is recommended. This is a once-and-for-all solution, and other large environments created later can also be automatically saved to the data disk.