stormpy icon indicating copy to clipboard operation
stormpy copied to clipboard

Circular import error

Open oyendrila-dobe opened this issue 3 years ago • 7 comments

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.

Screen Shot 2021-12-07 at 12 44 37 PM

oyendrila-dobe avatar Dec 07 '21 17:12 oyendrila-dobe

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.

volkm avatar Dec 10 '21 14:12 volkm

that makes sense. Thank you.

oyendrila-dobe avatar Dec 10 '21 23:12 oyendrila-dobe

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.

test.log setup.log

culechetoo avatar Jan 31 '24 18:01 culechetoo

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.

volkm avatar Feb 01 '24 08:02 volkm

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

culechetoo avatar Feb 02 '24 11:02 culechetoo

Try pip install nbval for the missing library.

volkm avatar Feb 02 '24 12:02 volkm

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?

culechetoo avatar Feb 02 '24 19:02 culechetoo