環境設定
Python3.X
2026/07/3076917の閲覧数
The Python versions included in the platform’s built-in images are fixed (e.g., Python 3.7, Python 3.8, Python 3.10, Python 3.12). If you need to use Python 3.6 (for example, TensorFlow 1.14 requires Python 3.6 or 3.7), you can use Miniconda to create a Python virtual environment with a different version.
# 构建一个虚拟环境名为:my-env,Python版本为3.7
conda create -n my-env python=3.7
# 更新bashrc中的环境变量
conda init bash && source /root/.bashrc
# 切换到创建的虚拟环境:my-env
conda activate my-env
# 验证
python
