FlexSim crashes when calling Python software

FlexSim crashes when calling Python software

supportPHJ4A
Collaborator Collaborator
1,708 Views
5 Replies
Message 1 of 6

FlexSim crashes when calling Python software

supportPHJ4A
Collaborator
Collaborator

[ FlexSim 22.1.0 ]

Hello everyone:

I encountered a problem, in the 2022.1 version, I simulated a very simple scenario of FlexSim calling Python. But strangely the model crashes, as shown in the GIF below: Is there any way to fix this situation? thanks.

flexsim-python.gif

0 Likes
Accepted solutions (1)
1,709 Views
5 Replies
Replies (5)
Message 2 of 6

JordanLJohnson
Autodesk
Autodesk
Accepted solution

Here are my thoughts:

  1. It looks like you picked the beta version, in the gif you showed. Please be sure to pick the released version, 22.1.1 or later. It also may be that the gif skipped a frame when you picked the correct version.
  2. Verify that python is available on your PATH. To verify, open a command prompt and run this command:
    python --version
    When you run this command, the command prompt should report a python version, rather than an error message.
  3. If the previous step gave you a version number (for example, mine reports 3.9.9), then you need to make sure that FlexSim is trying to connect to that version. The easiest way to check is to go to the Code tab in Global Preferences, and check the version there. Since my python version is 3.9.9, I use the 3.9 option:1652888613950.png

Let me know if you still are having trouble. But these are a few good things to try first.

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 3 of 6

supportPHJ4A
Collaborator
Collaborator

Thanks for your answer, I followed your prompt to set up and updated the software to 22.1.2. When I tested it again, The software did not prompt an error, it was forced to quit, just like the first GIF. Is there any other solution? thanks.cmd.pngflexsim.pngflexsim2.png

0 Likes
Message 4 of 6

JordanLJohnson
Autodesk
Autodesk

One thing to verify is that python itself is 64 bit. If you just enter "python" in the command line, you'll some additional information about the version:

1653414791131.png

Please verify that your python in 64-bit.

Other than that, I'm not sure what the issue could be. Perhaps having multi-byte characters in your PATH is an issue?

You may be able to build your own version of the PyConnector. We supply the code in this repository:
https://github.com/flexsim/FlexSimPy

You may also be able to build that project, and then debug it, to see what is happening when FlexSim tries to access that dll.

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 5 of 6

Jeanette_Fullmer
Community Manager
Community Manager

Hi @CSN, was Jordan Johnson's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes
Message 6 of 6

supportPHJ4A
Collaborator
Collaborator

Thanks for your answer, I found the problem, it should be because my file path contains Chinese characters, thanks again.