tl;dr
I get the error "DLL load failed while importing _bz2: The specified module could not be found." when using compiled Python libraries from FlexSim.
Long version
By itself, the connection between FlexSim and Python works: I can call simple test functions in Python from FlexSim and get back the expected result. However, things go wrong as soon as I call code that uses 3rd party libraries. After some trial and error, the problem seems to be specifically with compiled libraries (numpy, ortools, networkx, etc): as soon as FlexSim tries to call a function in a module that imports one of these, I get an error. 3rd Party libraries that are pure Python (e.g. requests), on the other hand, work fine.
Also, testing the relevant code outside of FlexSim, using the same interpreter, works fine.
Any advice on how to proceed would be appreciated!