Skip to content
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

Google Colab fails to install PyBaMM #2524

Closed
brosaplanella opened this issue Dec 5, 2022 Discussed in #2521 · 5 comments · Fixed by #2526
Closed

Google Colab fails to install PyBaMM #2524

brosaplanella opened this issue Dec 5, 2022 Discussed in #2521 · 5 comments · Fixed by #2526
Labels
bug Something isn't working

Comments

@brosaplanella
Copy link
Member

Discussed in #2521

Google Colab has updated to Python 3.8 but now fails to install PyBaMM due to pybtex.

Originally posted by reenubosepybamm December 5, 2022
%pip install pybamm -q # install PyBaMM if it is not installed
import pybamm
import numpy as np
import matplotlib.pyplot as plt
GIVING AN ERROR
PluginNotFound Traceback (most recent call last)
in
2 get_ipython().run_line_magic('pip', 'install pybamm --no-cache -q')
3 get_ipython().run_line_magic('pip', 'install pybamm -q # install PyBaMM if it is not installed')
----> 4 import pybamm
5 import numpy as np
6 import matplotlib.pyplot as plt

6 frames
/usr/local/lib/python3.8/dist-packages/pybtex/plugin/init.py in _load_entry_point(group, name, use_aliases)
79 for entry_point in pkg_resources.iter_entry_points(search_group, name):
80 return entry_point.load()
---> 81 raise PluginNotFound(group, name)
82
83

PluginNotFound: plugin pybtex.database.input.bibtex not found

@Saransh-cpp
Copy link
Member

This is a known pybtex issue, but till now, it was only affecting the pybamm.print_citations statements (seeing the error on import is new for me).

Reported last year here - pybamm-team/BattBot#47
Reported in pybtex here - https://bitbucket.org/pybtex-devs/pybtex/issues/148/error-pluginnotfound-plugin (I did not follow up. I will post a follow-up comment there.)

The error comes from -

citations = Citations()

because the __init__ method has -

self.read_citations()
self._reset()

Maybe we can execute these lines only when a user is not on Colab and throw a warning about citations when a user is on Colab (till this issue is fixed).

@valentinsulzer
Copy link
Member

Thanks @Saransh-cpp , sounds like a good workaround

@reenubosepybamm
Copy link

currently i am working in pybamm i,should i wait for the the bug to be cleared.or should i go to comsol

@Saransh-cpp
Copy link
Member

@reenubosepybamm you should be able to install PyBaMM's latest version in your local environment (not Google Colab) without any issues.

This issue has also been fixed and you can install the develop version of PyBaMM on Google Colab (till the time a new release is made) -

pip install git+https://github.com/pybamm-team/PyBaMM@develop

instead of -

pip install pybamm

@renatorod
Copy link

I have been using PyBaMM for most of 2022 with no issues, but since Google Colab was updated to Python 3.8, I have not been able to run any simulations.

I have tried the following fixes to no avail:

  1. Installed PyBaMM on Colab with pip install git+https://github.com/pybamm-team/PyBaMM@develop as suggested by @Saransh-cpp
  • Allows installing/importing pybamm, but throws an error when defining the model or the parameter_values
  • model = pybamm.lithium_ion.DFN(options={"thermal":"lumped"}) or parameter_values = pybamm.ParameterValues('Chen2020')
  • Error1: KeyError: 'Not a bibtex citation or known citation: Ai2019'
  • Error2: KeyError: 'Not a bibtex citation or known citation: Chen2020'
  1. Attempted installation on my local environment (desktop) with pip install pybamm
  • Throws an ERROR during installation
  • ERROR: PluginNotFound: plugin pybtex.database.input.bibtex not found
  1. Installed PyBaMM on my local environment (desktop) with pip install git+https://github.com/pybamm-team/PyBaMM@develop
  • Allows installation but throws an ERROR during import pybamm
  • ERROR: PluginNotFound: plugin pybtex.database.input.bibtex not found

Any other suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants