Selected Python version in GUI not used for Python uwsgi application site; undocumented mechanism behind it #269

Closed
opened 2026-04-05 20:26:21 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @xuiqzy on 2/8/2024

CloudPanel version(s) affected

2.4.1-1+clp-jammy (cloudpanel UI doesn't show it's version)

Description

Installing and selecting another python version doesn't actually use the other python version for the uwsgi app.

How is it supposed to be used? Just as a env var that is available like the app_port variable?
How to actually use another python version with a uwsgi python app?

How to reproduce

Install python3.12 from deadsnakes PPA on ubuntu. (Or other way to make it available on the system)
Select python3.12 for a python project in the dropdown.
Deploy a simple flask app in a virtual environment and configure the my_site.ini config for uwsgi according to docs. (Might need to set pythonpath for it to recognize the installed dependencies correctly with the virtual environment)
When printing the python version in the flask app it is still 3.10.

Possible Solution

Explain in documentation how python version that is selected in GUI is actually used to help people to understand when they can rely on this functionality and when they need to do something themselves. It would also be helpful to debug these issues if the general functioning of this python version feature would be explained. For what executables is it used? For the uwsgi executable? Is the building and installation of a different python uwsgi plugin needed like https://stackoverflow.com/questions/23872801/running-multiple-uwsgi-python-versions suggests?
Explain how to correctly edit the .ini uwsgi config, if needed additionally, in the docs for adding a new python version.

Additional Context

Even setting the py-program-name to the python3.12 executable inside the my_site.ini config for uwsgi doesn't change which python version is used (but would also negate the use of the dropdown in cloudpanel and should be explained why both needed).

*Originally created by @xuiqzy on 2/8/2024* ### CloudPanel version(s) affected 2.4.1-1+clp-jammy (cloudpanel UI doesn't show it's version) ### Description Installing and selecting another python version doesn't actually use the other python version for the uwsgi app. How is it supposed to be used? Just as a env var that is available like the app_port variable? How to actually use another python version with a uwsgi python app? ### How to reproduce Install python3.12 from deadsnakes PPA on ubuntu. (Or other way to make it available on the system) Select python3.12 for a python project in the dropdown. Deploy a simple flask app in a virtual environment and configure the `my_site.ini` config for uwsgi according to docs. (Might need to set `pythonpath` for it to recognize the installed dependencies correctly with the virtual environment) When printing the python version in the flask app it is still 3.10. ### Possible Solution Explain in documentation how python version that is selected in GUI is actually used to help people to understand when they can rely on this functionality and when they need to do something themselves. It would also be helpful to debug these issues if the general functioning of this python version feature would be explained. For what executables is it used? For the uwsgi executable? Is the building and installation of a different python uwsgi plugin needed like https://stackoverflow.com/questions/23872801/running-multiple-uwsgi-python-versions suggests? Explain how to correctly edit the `.ini` uwsgi config, if needed additionally, in the docs for adding a new python version. ### Additional Context Even setting the `py-program-name` to the python3.12 executable inside the `my_site.ini` config for uwsgi doesn't change which python version is used (but would also negate the use of the dropdown in cloudpanel and should be explained why both needed).
Sign in to join this conversation.