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

Import error when running surface_currents.ipynb on Binder #12

Open
lqgentner opened this issue Dec 28, 2023 · 6 comments · Fixed by #13
Open

Import error when running surface_currents.ipynb on Binder #12

lqgentner opened this issue Dec 28, 2023 · 6 comments · Fixed by #13
Labels
bug Issues that present a reasonable conviction there is a reproducible bug.

Comments

@lqgentner
Copy link

Dear all,

I discovered your notebook to learn about batch generation with xarray datasets for machine learning.
Sadly, I am not able to run the first cell in surface_currents.ipynb:

import xarray as xr
ImportError: cannot import name 'TypedDict' from 'typing' (/srv/conda/envs/notebook/lib/python3.7/typing.py)

Possible solution
The binder environment currently uses Python 3.7. Switching to Python 3.8 or newer should solve the import error.

If I can change the Python version of the Binder environment myself, I would be grateful for a hint!

Thank you,
Luis

@lqgentner lqgentner added the bug Issues that present a reasonable conviction there is a reproducible bug. label Dec 28, 2023
@cmdupuis3
Copy link
Collaborator

I'm seeing this too.

@brian-rose Could you transfer this issue to the right repo?

@brian-rose
Copy link
Member

@cmdupuis3 I don't think there's a better place for this issue, if it pertains to the Binder image for this cookbook.

Let's try modernizing the environment file in this repo and see if that gets us anywhere.

@brian-rose
Copy link
Member

@cmdupuis3 After merging #13, there's a new Binder image running Python 3.10. The import error is gone, but some new errors are popping up farther down in the notebook. Maybe you can try running on the Binder and take a look? I don't know much about the actual contents of this cookbook.

@cmdupuis3
Copy link
Collaborator

😬 At a first glance, I believe it's a problem related to the intake library. Maybe the syntax changed or something, but I'm actually not that familiar with the library.

from intake import open_catalog
cat = open_catalog("https://raw.githubusercontent.com/pangeo-data/pangeo-datastore/master/intake-catalogs/ocean/CESM_POP.yaml")
cat['CESM_POP_hires_control']

I also tried it in python 3.12, but it seems there's also a dependency on distutils, which is deprecated in 3.12.

@brian-rose
Copy link
Member

Interesting, I see that our Intake Cookbook is also failing. Maybe related? I'll open an issue over there.

@brian-rose
Copy link
Member

As I noted over at ProjectPythia/intake-cookbook#33, Intake 2.0 was released in Feb 2024 and there seem to be some backwards incompatible changes. That's about as far as I can get right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that present a reasonable conviction there is a reproducible bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants