-
-
Notifications
You must be signed in to change notification settings - Fork 581
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
PyBaMM import error - Cannot run anything (import broken due to pybtex
)
#3940
Comments
Perhaps #3886 broke this where the try-catch blocks everywhere were removed? I haven't looked at this in enough detail, but the breakage is coming from this instantiation of the citations = Citations() where |
Hmm, I somehow can't reproduce this locally. I'm not sure where is this originating from. |
Me neither |
I haven't looked at this again, but I think having it fail in a fresh CI environment means there is indeed a bug, even if we can't reproduce it on our own machines. I added the "high priority" label for now. Maybe a fix can be to register the PyBaMM and NumPy papers only inside the |
Let me look into this. |
|
I had a chance to look at the issue and understand the problem. Actually at the moment pybamm has a hidden mandatory dependency, namely parse_file = import_optional_dependency("pybtex.database", "parse_file") During #3892 the error was still masked in try:
self.read_citations()
self._reset()
except Exception as e: # pragma: no cover
self._citation_err_msg = e Beyond that, the error was not reported after for a subtle issue. When we don't have the optional libraries installed locally (e.g., from local with Instead, when we have the optional libraries installed (e.g. from CI with Possible solution steps:
I could work on this in a shared PR with @prady0t. |
Thanks for posting this here, @lorenzofavaro, I think this is a reasonable solution based on our conversation earlier. You mentioned that you're working on some aspects of this too, so I'll assign you to this alongside @prady0t. |
Hey @agriyakhetarpal, I won't be able to work on anything for at least a week due to a minor road accident. If @lorenzofavaro you are able to completely take care of this please go ahead. |
Sorry to hear that @prady0t, Get well soon. |
Thanks a lot 🤗 |
Discussed in #3928
Originally posted by abhishek-appana March 25, 2024
Hello,
I am running Python 3.11.8 and installed PyBaMM 24.1 using pip on a Windows system. Earlier I was using Python 3.10 and everything was fine. But I am getting the below error after upgrading Python.
When I run
import pybamm
, it gives me the error:ModuleNotFoundError: Optional dependency pybtex.database is not available. See https://docs.pybamm.org/en/latest/source/user_guide/installation/index.html#optional-dependencies for more details.
I tried installing pybamm using
pip install pybamm[all]
. I was still getting this error. How do I resolve this?I think that this is a valid bug and it is still failing, and
import pybamm
should work without installingpybamm[all]
. It can be noticed in the logs here: https://github.com/pybamm-team/PyBaMM/actions/runs/8461852686/job/23182296194, so I've converted this discussion to an issue instead (cc: @Saransh-cpp @arjxn-py).Perhaps this isn't being properly checked through #3892, @lorenzofavaro?
The text was updated successfully, but these errors were encountered: