Skip to main content

Install and Switch Python Versions

aifare platform images all come with Miniconda pre-installed, supporting flexible creation and switching of different Python virtual environments.

Check Current Python Version

python --version

Create a Python Virtual Environment with a Specific Version

For example, to create a Python 3.7 environment:

conda create -n my-env python=3.7
  • my-env is the name of the virtual environment and can be customized
  • python=3.7 can be replaced with the required version (e.g., 3.8, 3.10, 3.12, etc.)

Activate the Virtual Environment

conda init bash && source /root/.bashrc
conda activate my-env

Verify Python Version

python --version

Common Issues

  • If you need to install Python 3.6 (e.g., TensorFlow 1.14 requires 3.6/3.7), use the above command to create it.
  • Each virtual environment is independent; install/run dependencies after switching environments.
  • It is recommended to use conda to manage Python versions to avoid system environment confusion.

For more Python environment management tips, please refer to the Miniconda official documentation or aifare platform community resources.