stormpy
stormpy copied to clipboard
Circular import error
I'm trying to use the parse_prism_program
method. The python script can recognize all the other modules except the core module. I have installed stormpy in a directory, and moved the lib/stormpy
and lib/stormpy.egg-info
into a folder with my python scripts that calls stormpy. Is there something I'm doing wrong or missing out? What should I do to make python recognize the core module? I did try to specifically import stormpy.core
, but the error is still the same.

Copying python files might lead to some problems, because the file structure can change. You can try to get your current setup to work, but I cannot be of much help there. My recommendation is to use a virtual environment and install stormpy according to our guide. In that case you can install stormpy in a custom folder of your choice and do not need to copy any files.
that makes sense. Thank you.
I also got this error. I installed version 1.8.0 using the given instructions. I am using a virtual environment with Python 3.10. I have attached the setup and test logs.
I think the issue comes from missing libraries. You are building stormpy without the optional libraries for parameters, POMDPs, etc. However, some of the examples are checking for these. Can you try to run the following?
pip install pytest
python -m pytest tests
This should only run some of the tests and skip the ones for the optional libraries.
I now got the following output.
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --nbval
inifile: /Users/cgarwal/PycharmProjects/stormpy/setup.cfg
rootdir: /Users/cgarwal/PycharmProjects/stormpy
Try pip install nbval
for the missing library.
Thanks. Now I see that several tests are skipped but it goes through.
However, I believe I followed the installation path for all dependencies (carl and storm) that installed all recommended libraries. Based on the test log above, could you tell me if I perhaps missed a step or is the documentation lacking?