-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
[Bug]: Error with EntryPoints #2534
Comments
I tried to download Spyder on Mac to test this but it's not working. Can you download Spyder and try? |
Just for completeness, here is the error message as text. I will try to reproduce it in my machine. |
Ok, that's very weird. I used Spyder to try and reproduce the error and it runs fine for me with PyBaMM 22.11. |
Hi, I just updated to PyBaMM 22.11 and run into the same error using jupyter-notebook (python 3.9). Any ideas? |
Can you test with v22.11.1? |
For me still the same error with v22.11.1 |
Dears, I am using v22.11.1 (installed on a machine) with Python 3.9.5. My IDE is Spyder 5. I am running into the same problem. This verifies for all the files where a full set of parameter_values is invoked. NB: files that does not require so (e.g. initial tutorial 10 and 11) run regularly. For example, I copy/paste the traceback obtained when running Tutorial 1 (initial tutorial): `runfile('C:/Pybamm_material/Init_tutorials/Pybamm_tutorial_1.py', wdir='C:/Pybamm_material/Init_tutorials') File "C:\Pybamm_material\Init_tutorials\Pybamm_tutorial_1.py", line 15, in File "C:\Users\MF\AppData\Local\Programs\Python\Python39\lib\site-packages\pybamm\simulation.py", line 72, in init File "C:\Users\MF\AppData\Local\Programs\Python\Python39\lib\site-packages\pybamm\models\full_battery_models\lithium_ion\base_lithium_ion_model.py", line 83, in default_parameter_values File "C:\Users\MF\AppData\Local\Programs\Python\Python39\lib\site-packages\pybamm\parameters\parameter_values.py", line 81, in init File "C:\Users\MF\AppData\Local\Programs\Python\Python39\lib_collections_abc.py", line 768, in contains File "C:\Users\MastropierroF\AppData\Local\Programs\Python\Python39\lib\site-packages\pybamm\parameters\parameter_sets.py", line 51, in getitem TypeError: 'EntryPoint' object is not callable` |
I have the same problem, can't find any solution. Any help or suggestion thanks runfile('C:/Users/e179109/untitled0.py', wdir='C:/Users/e179109') File "C:\Users\e179109\Anaconda3\lib\site-packages\spyder_kernels\py3compat.py", line 356, in compat_exec File "c:\users\e179109\untitled0.py", line 16, in File "C:\Users\e179109\Anaconda3\lib\site-packages\pybamm\simulation.py", line 72, in init File "C:\Users\e179109\Anaconda3\lib\site-packages\pybamm\models\full_battery_models\lithium_ion\base_lithium_ion_model.py", line 83, in default_parameter_values File "C:\Users\e179109\Anaconda3\lib\site-packages\pybamm\parameters\parameter_values.py", line 81, in init File "C:\Users\e179109\Anaconda3\lib_collections_abc.py", line 769, in contains File "C:\Users\e179109\Anaconda3\lib\site-packages\pybamm\parameters\parameter_sets.py", line 51, in getitem TypeError: 'EntryPoint' object is not callable |
What does the following script print? import importlib_metadata
for entry_point in importlib_metadata.entry_points(group="pybamm_parameter_sets"):
print(type(entry_point))
print(isinstance(entry_point, importlib_metadata.EntryPoint)) |
Output from Spyder (pybamm installed on machine) and output from jupyter (on virtual environment after typing "import pybamm") <class 'setuptools._vendor.importlib_metadata.EntryPoint'> Output from jupyter (on virtual environment typing the script without any prior command): |
Thanks, this will help to fix the problem, could you run this to make sure the fix will work import importlib_metadata
import setuptools._vendor.importlib_metadata as setuptools_metadata
for entry_point in importlib_metadata.entry_points(group="pybamm_parameter_sets"):
print(
isinstance(
entry_point, (importlib_metadata.EntryPoint, setuptools_metadata.EntryPoint)
)
) |
PyBaMM Version
22.11
Python Version
3.9
Describe the bug
Two users have brought up to my attention that they get this error when trying to run their scripts in PyBaMM 22.11 (didn't occur in 22.10). The scripts are very standard, and both users use Spyder so I suspect the issue is related to that (I couldn't reproduce the error neither in Windows and Linux, but I am using VS Code).
Steps to Reproduce
Run a script with PyBaMM 22.11 in Spyder.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: