Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Python environment setup for new FVPs #26

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions DoxyGen/simulation/src/Ref_vsi_py.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,30 @@ The path to the python files implementing used interfaces shall be provided via

\defgroup arm_vsi_pyenv Python environment setup
\ingroup arm_vsi_py
\brief Python environment for Arm FVPs
\details

Arm FVPs require an installation of <b>Python 3.9</b> for running the Python virtual interfaces. If you are using a Windows machine you can use an embedded Python installation in FVPs root directory, otherwise a system installation is required.
Additional Python packages can be added using \em pip. In case you are using embedded Python installation see section: \ref embedded-pip-vsi
Arm FVPs require an installation of <b>Python 3.9</b> for running the Python virtual interfaces. Additional Python packages can be added using \em pip.

# Python requirements
The following packages are required on Linux systems (Ubuntu 20.04 and later):
- \em libatomic1
- \em libpython3.9
- \em python3.9
- \em python3-pip

Run the following command to install required packages on Ubuntu:
\code{.sh}
sudo apt install libatomic1 libpython3.9 python3-pip
sudo apt install libatomic1 python3.9 python3-pip
\endcode

# Install additional packages in embedded Python {#embedded-pip-vsi}
# Known issues
- Some Python packages can't be imported directly in the Python virtual interfaces, because they are incompatible with Python sub-interpreters (e.g. \em numpy). Possible workaround for this issue is to split the Python module into client and server scripts.


# Setup for FVPs older than 11.26

If you are using a Windows machine you can use an embedded Python installation in FVPs root directory, otherwise a system installation is required.

## Install additional packages in embedded Python
By default the embedded Python installation on Windows does not support installation of new packages using pip. To enable installing new packages follow the steps described below.
- Download [get-pip.py](https://bootstrap.pypa.io/get-pip.py) to the FVPs root directory.
- Uncomment the following line in the \b python39._pth file.
Expand All @@ -49,8 +55,7 @@ By default the embedded Python installation on Windows does not support installa
\endcode
The packages will be installed in <code>Lib\\site-packages</code> subfolder.

# Known issues
- Some Python packages can't be imported directly in the Python virtual interfaces, because they are incompatible with Python sub-interpreters (e.g. \em numpy). Possible workaround for this issue is to split the Python module into client and server scripts.
## Known issues
- Fast Models (Version 11.22.39) available through vcpkg include a stripped-down version of libpython3.9 library on Linux systems. This can cause the Fast Model to close with an error (<em>VSI:Video:ImportError: No module named '_posixsubprocess'</em>) when running applications with VSI.
Current workaround:
- Rename or remove included \em libpython3.9.so.1.0 file, located in the vcpkg installation folder
Expand Down
2 changes: 1 addition & 1 deletion interface/video/python/vsi_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def init(address, authkey):
if os_name == 'nt':
py_cmd = 'python'
else:
py_cmd = 'python3'
py_cmd = 'python3.9'
cmd = f"{py_cmd} {server_path} "\
f"--ip {address[0]} "\
f"--port {address[1]} "\
Expand Down
Loading