Translating Python in a virtual environment

This section describes how to translate Python projects in virtual environments. Make sure that all project dependencies are installed in your virtual environment. To translate a Python project in a virtual environment, include the -python-path option to specify the project dependencies.

Python virtual environment example

To translate a Python project where the virtual environment name is myenv and the dependencies for the project are installed in the myenv/lib/python<version>/site-packages directory, type:

sourceanalyzer –b mybuild -python-path "myenv/lib/python<version>/site-packages/" myproject/

Conda environment example

To translate a Python project where the conda environment name is myenv and the project dependencies are installed in the <conda_install_dir>/envs/myenv/lib/python<version>/site-packages directory, type:

sourceanalyzer –b mybuild -python-path "<conda_install_dir>/envs/myenv/lib/python<version>/site-packages/" myproject/