question

VikSin avatar image
0 Likes"
VikSin asked VikSin answered

Python function error: Windows Error Code : 126

Hello,

I have problem with running external python command. My colleague has same command, same python code and doesn´t have any problem when running it.
testpy.py
Python code is simple, just counting two numbers together.

Can somebody help ? I will be grateful for any answer.Python_test.fsm
simple_python_method.pnguser_command.pngerror.png

FlexSim 22.2.0
pythonuser command
user-command.png (57.0 KiB)
error.png (43.3 KiB)
python-test.fsm (44.9 KiB)
testpy.py (82 B)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

VikSin avatar image
3 Likes"
VikSin answered

Problem solved, after hundreds of tries and prayers. It seems that the problem is in setting correct windows PATH. I tried first with my actual python version, it not works but after uninstalling all my pythons version and reinstalling python 3.10 it seems to works.

1) I uninstall all my python versions from computer, then reinstall python 3.10 from original site: https://www.python.org.
2) I set my correct PATHS at settings-system-advanced system settings-environment variables
some good tutorial can be found here:
How to Add Python to PATH – Real Python

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.