-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ozone doesn't import, 'ModuleNotFoundError: No module named 'ozone.historical'' #119
Comments
I'm having this issue, how can I fix it? |
@isi1000 Hey! Still trying to figure out what exactly is going wrong with that import, but we'll have it fixed soon! If you simply want to use the rest of Ozone's features (non historical data features), you can try using Ozone v1.5.5:
If you'd like to work on it and contribute to Ozone, then that's great too. I'd experiment with the import to try and understand why it's behaving that way. |
@lahdjirayhan I think I've managed to solve this quite simply. The error appeared to be indicating that it couldn't find the module. By adding an init.py in the historical directory, it turns it into a local package, and the error goes away. I'll confirm this with a testPyPI package upload to check if it has actually worked. EDIT: It didn't work... kinda? When I locally import the package (in a virtual env where ozone hasn't been pip installed), it does work. However, After uploading to testPyPI as a package here, and then installing that, It throws a different error. Shown below: |
I didn't see that coming. @Milind220 As for giving The last image you sent indicates that If it is, one hackish workaround would be just taking the content of The EDIT: I've tried installing from test-PyPI in a new separate venv. I can replicate your error @Milind220. When I manually copy-pasted a |
@lahdjirayhan @Milind220 (EDIT)I sort out the problem by just coping in ozone.py all the _reverse_engineered.py code and changing the location of the relevant_funcs.js archive to the same folder. |
Yeah I'll check it out too, though that would make sense!
Hahaha this would work, and that's the main thing. We can go with this.
Great! I'll take a look now too :) EDIT
Was the init.py needed at all? or was it just the missing .js file that was wreaking havoc? EDIT 2Okay, so it's just the relevant_funcs.js file that was required, not the init.py. Awesome! |
@isi1000 Great, seems to confirm what @lahdjirayhan was thinking too! |
I could either fix this myself OR 👀 @isi1000 Would you like to try fixing this and contributing to Ozone? This is a pretty simple little fix by the looks of it. No worries if you don't want to, of course :) EDIT: To suggest up what has to be done
_context.execute(_JS_FUNCS) |
Awesome, everyone!
I really don't know with regards to init. But judging from the initial error you found: |
I'd like to get this fixed asap, so someone hold my beer, I got this |
Fixed this with 0e289df |
I can confirm that the new hotfix solves this issue on my machine. |
That's great! You may notice that the commits in the hotfix didn't pass the pre-commit/pre merge lints. The relevant_funcs.py file kept failing flake8 formatting criteria (lines were 'too long'), and black didn't seem to reformat it at all. At that point I just committed with --no-verify to avoid triggering the pre commit hooks. |
I would say it's safe to just add |
Excellent, I'll add that in |
Here is the complete error message when I try to import Ozone while using it as a user would.
Jupyter Notebook
Python file
It sounds like it has something to do with the relative import.
The text was updated successfully, but these errors were encountered: