Hi Community,
When you install a solution you may have received an error from Poetry stating that the Python version is wrong. Something like this for instance:
Traceback (most recent call last):
File "D:\AnsysDev\08.Demo\cop-demo\setup_environment.py", line 778, in <module>
main()
File "D:\AnsysDev\08.Demo\cop-demo\setup_environment.py", line 721, in main
check_inputs(args)
File "D:\AnsysDev\08.Demo\cop-demo\setup_environment.py", line 272, in check_inputs
check_python_version(args)
File "D:\AnsysDev\08.Demo\cop-demo\setup_environment.py", line 238, in check_python_version
raise Exception(f"Python version must be lower than or equal to {upper_version}.")
Exception: Python version must be lower than or equal to 3.9.
This is due to the fact that the Python version in use violates the Python version constraints defined in the configuration file (pyproject.toml).
To check the Python version constraints, open the configuration file (pyproject.toml), find the [tool.poetry.dependencies] section and find the python parameter.
python = ">=3.7, <3.9"
By default, the solution templates constraint the Python version between 3.7 and 3.8 (like in the examples above). The reason for this is that SAF components (GLOW and Portal) are currently only supporting these two versions.
We are working at removing this limitation and extending GLOW and Portal to Python 3.9, 3.10 and 3.11. More information to come.
In the meantime, we recommend that you use 3.7 or 3.8.
Thank you.