-
-
Notifications
You must be signed in to change notification settings - Fork 563
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 fails when running script a second time in spyder on windows #1479
Comments
Is this maybe related to #1475 ? @priyanshuone6 any ideas what is going wrong? |
@TomTranter Could you provide a minimal example and steps to reproduce please? |
I could dig deeper after I get the steps to reproduce this bug |
I'm using spyder on windows - running any script twice without restarting the kernel results in the above error. Still happening - any ideas? |
Seems to be ok when I run example scripts from the pybamm directory but not scripts from another folder |
Think I fixed it by putting empty init files into all the parameter subfolders |
Describe the bug
Running any script more than once seems to result in an import error because of the recent changes to parameters
File "", line 908, in _find_spec
AttributeError: 'ImportDenier' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tom\code\PyBaMM\examples\scripts\drive_cycle.py", line 14, in
param = model.default_parameter_values
File "c:\users\tom\code\pybamm\pybamm\models\full_battery_models\base_battery_model.py", line 346, in default_parameter_values
return pybamm.ParameterValues(chemistry=pybamm.parameter_sets.Marquis2019)
File "c:\users\tom\code\pybamm\pybamm\parameters\parameter_values.py", line 73, in init
self.update_from_chemistry(chemistry)
File "c:\users\tom\code\pybamm\pybamm\parameters\parameter_values.py", line 216, in update_from_chemistry
self.update(
File "c:\users\tom\code\pybamm\pybamm\parameters\parameter_values.py", line 301, in update
loaded_value = pybamm.load_function(os.path.join(path, value[10:]))
File "c:\users\tom\code\pybamm\pybamm\util.py", line 273, in load_function
module_object = importlib.import_module(path)
File "C:\Users\tom\anaconda3\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 961, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 971, in _find_and_load_unlocked
File "", line 910, in _find_spec
File "", line 884, in _find_spec_legacy
File "C:\Users\tom\anaconda3\lib\site-packages\IPython\external\qt_loaders.py", line 48, in find_module
if path:
File "", line 1183, in len
File "", line 1162, in _recalculate
File "", line 1158, in _get_parent_path
KeyError: 'pybamm.input.parameters.lithium_ion'
The text was updated successfully, but these errors were encountered: