Configuring a Python Environment
To facilitate the access to TVM using Python, build a Python virtual environment. Python 3.7 or 3.8 is recommended. Python 3.9 is not supported yet.
- Obtain the Anaconda installation package by following instructions in OS and Software Requirements.
1wget https://repo.anaconda.com/archive/Anaconda3-2024.10-1-Linux-aarch64.sh - Run the installation script and complete the installation and initialization as prompted.
1bash Anaconda3-2024.10-1-Linux-aarch64.sh - Reactivate the shell.
1source ~/.bashrc
- Check whether Anaconda is successfully installed. If Anaconda is successfully installed, the installed package is displayed in the command output.
1conda list - Use conda to build a Python 3.7 virtual environment and activate it.
1 2
conda create -n tvm python=3.7 conda activate tvm
- Configure the PIP source. Open or create the ~/.pip/pip.conf file and add the following content:
1 2
[global] index-url = https://mirrors.huaweicloud.com/repository/pypi/simple/
- Create the requirements.txt file to specify the Python dependencies to be installed.
numpy==1.19.2 decorator attrs typing-extensions psutil scipy tornado xgboost==1.5.0 pybind11 cython==0.29.32 pythran cloudpickle synr==0.6.0 pytest junitparser onnx
- Install the software packages specified in the requirements.txt file.
1pip install -r requirements.txt
Parent topic: Configuring the Compilation Environment