FlexSim crashes while running external Python code

FlexSim crashes while running external Python code

jacopo_r
Not applicable
122 Views
16 Replies
Message 1 of 17

FlexSim crashes while running external Python code

jacopo_r
Not applicable

[ FlexSim 24.0.1 ]

Hi,

I have a FlexSim model that is connected to a python file that aims to do some optimization. Unfortunately, I cannot share the files.

My issue is that, while the model was working and running the optimization until a couple of days ago, it now crashes every time the system has to execute the line of code that runs the external code.

Does anyone have any idea why it was working and it doesn't work anymore?

These are my computer specs and they should be ok for doing what I am doing. (when it was working, the running of the external code was taking around 15 sec after I pressed the Run Model button)
Processor: 12th Gen Intel(R) Core(TM) i7 2.10 GHz
RAM: 32 GB

0 Likes
123 Views
16 Replies
Replies (16)
Message 2 of 17

jason_lightfootVL7B4
Autodesk
Autodesk
We're going to have trouble assisting you if we can't reproduce the problem. Would you be able to post the model and python module if you made the post private?
0 Likes
Message 3 of 17

jacopo_r
Not applicable

Hi @Jason Lightfoot,

I just tried to run a very simple python code form flexsim and it also crashed. I am sharing this simple function (which was working). So it is something general and not just related to a specific model. What should I check? The pyhton version selected in the flexsim global preferences is the same one I have installed in my PC, and the python path is added to PATH.

Thanks in advance.

Reading_Flexsim_Table.pyPython_reading_table.fsm

0 Likes
Message 4 of 17

jacopo_r
Not applicable
Hi again @Jason Lightfoot , any new comments on my issue?
0 Likes
Message 5 of 17

jason_lightfootVL7B4
Autodesk
Autodesk
We were able to run the python code (once we ensured the pyhon filename case matched that in your code) so it's likely a system issue. Can you describe your 'crash' in more detail? Can you try a different Python version and check everything is supported and set up correctly on your machine?
0 Likes
Message 6 of 17

jacopo_r
Not applicable
Every time I press the Run button, or more specifically, every time the line of code connecting to the python file has to be executed, the FlexSim app just shut down and it closes. the weird thing is that it was working properly and then it stopped. The only thing I think I did in between was to uninstall and re-install python. I had to to this to solve other issues having VS code keeping updating python to the latest version (which is not supported by FlexSim). So I uninstalled all python versions I had, and now I only have Python 3.10.

I re-installed the 3.10 in the same way as I previously did, so it should be able to work. Or at least, if FlexSim was not be able to connect to Python, I would expect some error messages and not the app to shut down.
Is there anything else I can do to double check that I set up everything correctly?

0 Likes
Message 7 of 17

lars_jacobsen_ScandiSim
Advocate
Advocate

Will it be possible to test if FlexSim also crashes, if you run it on non-corporate pc, i.e. your own private pc?

0 Likes
Message 8 of 17

jacopo_r
Not applicable

Not really as I have MacOS in my private computer. It is very weird the way it stopped working.

In regards of setting to check, what are the requirement FlexSim has in order to be working with Python? I only remember that Pyhton has to be in the PATH variables. Anything else?

0 Likes
Message 9 of 17

lars_jacobsen_ScandiSim
Advocate
Advocate
You are not the only one with this problem. So far it seems to be related to a corporate setup. Can you get one of your colleges to test it on a non-corporate pc? I.e. Martin Jensen
0 Likes
Message 10 of 17

jacopo_r
Not applicable
I see. I will ask Martin Jensen then. It will not before next week btw, so if in the meanwhile something new pops up from your side, please keep me in the loop.

Thanks

Message 11 of 17

Jeanette_Fullmer
Community Manager
Community Manager

Hi @jacopo-r,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes
Message 12 of 17

jacopo_r
Not applicable
Hi @Jeanette F ,


I did not have the chance to try with a personal PC as Lars suggested.
I ended up not using the flexsim-python connection, because that still made the flexsim app to shut down.

So, the problem has not been fixed from my side and I don't know when I will have some time to take a look at it again.

There is no real answer to accept as a solution for this post, so please do what you think is the best with this question.


BR,

Jacopo

0 Likes
Message 13 of 17

lars_jacobsen_ScandiSim
Advocate
Advocate

@jacopo_r . Try an installing a slightly older version of Python and change the windows python path


Python application path

0 Likes
Message 14 of 17

Jeanette_Fullmer
Community Manager
Community Manager
Hello @jacopo_r,

Did you try Lars Christian's suggestion?

0 Likes
Message 15 of 17

jacopo_r
Not applicable
Hi @Jeanette F , actually not. Didn't have the chance yet. But thank you @Lars Christian J2 , I will try that as soon as I can.


BR
Jacopo

0 Likes
Message 16 of 17

Jeanette_Fullmer
Community Manager
Community Manager

Hi @jacopo-r,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes
Message 17 of 17

jacopo_r
Not applicable
Hi @Jeanette F ,


feel free to close the question. At the moment I am not interested in fixing the problem as I found a work-around. So in case I will try what suggested above or I'll write another post.

BR,

Jacopo

0 Likes