rajeshrinet / pyross

PyRoss: inference, forecasts, and optimised control of epidemiological models in Python. github.com/rajeshrinet/pyross
https://pyross.readthedocs.io
MIT License
169 stars 57 forks source link

ModuleNotFoundError: No module named 'pyross.models' #3

Closed saadtaame closed 4 years ago

saadtaame commented 4 years ago

I followed the installation steps but I am getting this error when I import pyross:

import pyross Traceback (most recent call last): File "", line 1, in File ".../Desktop/pyross/pyross/init.py", line 1, in import pyross.models ModuleNotFoundError: No module named 'pyross.models'

rajeshrinet commented 4 years ago

@saadtaame please can you change your folder, import again, and let me know?

saadtaame commented 4 years ago

@rajeshrinet It works when I change the folder!

rajeshrinet commented 4 years ago

@saadtaame thanks for the quick update. If you are in that folder then it picks the folder and not the installation. Since that folder gets priority.

Cheers

philip-mach commented 4 years ago

Could you clarify what change the folder means? I ran the example from the install (pyross directory and got the same issue). I also tied running from other directories with the same result.

Thanks.

rajeshrinet commented 4 years ago

@philip-mach the problem is with init file which is in the pyross folder (it contains pyross.models). I had to write in this way because of some python3 issue I was getting.

I hope it works from the example folder and other. I need to look into this in more detail soon.

Does this make sense?

philip-mach commented 4 years ago

I tried several options – can you tell me more about the configuration on your system?

It’s puzzling as the usual convention is that if you put the init.py in a directory to signify that the directory is a module, and if that directory is within the one where you run, you need no path to find it.

I haven’t used Cython before – maybe there is something wrong there. I will try to make sense of this but help useful.

rajeshrinet commented 4 years ago

Please can you install as described and then go to the example folder. Run ex1 jupyter notebook and share the error message you get?

Thanks

philip-mach commented 4 years ago

Sorry I am bit slow – a lot going on here. So it needs to run in Jupyter? In the midst of all this I am running into computers dying on me so not the best timing for working on this. I will try to get myself reset and take another look at it tomorrow – South African government is very keen to get a version of this so I must keep pushing on. Thanks for the help.

ronojoy commented 4 years ago

@philip-mach, why do you not try the Binder link ? This will not require you to install anything. Please be patient while the image builds, but after that, it will work as if you were on your own device. Please also pay heed to the caveats we issued in our paper - decisions must not be based on model forecasts alone.

philip-mach commented 4 years ago

Now we’re getting somewhere, thanks. I will check it out further.

I understand the limits of models but good that you check.

philip-mach commented 4 years ago

I am finding the online Binder thing a little too slow. After another try it looks doable to install on my own machine – I missed the fact that I needed Jupyter.