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

Error when importing altair using Python 3.13 #3620

Closed
rikardn opened this issue Oct 1, 2024 · 4 comments
Closed

Error when importing altair using Python 3.13 #3620

rikardn opened this issue Oct 1, 2024 · 4 comments
Labels

Comments

@rikardn
Copy link
Contributor

rikardn commented Oct 1, 2024

What happened?

I am testing altair 5.4.1 with Python 3.13 rc2 and got the following error when trying to import:

$ python
Python 3.13.0rc2 (main, Oct  1 2024, 14:50:48) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import altair
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import altair
  File "/home/devel/pharmpy/.tox/py313/lib/python3.13/site-packages/altair/__init__.py", line 650, in <module>
    from altair.vegalite import *
  File "/home/devel/pharmpy/.tox/py313/lib/python3.13/site-packages/altair/vegalite/__init__.py", line 2, in <module>
    from .v5 import *
  File "/home/devel/pharmpy/.tox/py313/lib/python3.13/site-packages/altair/vegalite/v5/__init__.py", line 4, in <module>
    from .api import *
  File "/home/devel/pharmpy/.tox/py313/lib/python3.13/site-packages/altair/vegalite/v5/api.py", line 618, in <module>
    class _ConditionClosed(TypedDict, closed=True, total=False):  # type: ignore[call-arg]
    ...<6 lines>...
        value: Any
TypeError: _TypedDictMeta.__new__() got an unexpected keyword argument 'closed'
>>> 

What would you like to happen instead?

No response

Which version of Altair are you using?

5.4.1

@rikardn rikardn added the bug label Oct 1, 2024
@dangotbanned
Copy link
Member

dangotbanned commented Oct 1, 2024

@rikardn this will be fixed in the next release.
This PR is relevant

There is also a change here that is needed for PEP 728 support on 3.13:

if sys.version_info >= (3, 14):
from typing import TypedDict
else:
from typing_extensions import TypedDict

More generally though, altair cannot be tested on 3.13 due to issues upstream.
I would recommend following these for progress towards 3.13 support:

@rikardn
Copy link
Contributor Author

rikardn commented Oct 3, 2024

Thanks @dangotbanned for taking the time to explain the situation.

@dangotbanned
Copy link
Member

@rikardn we've just merged #3591, so I'm closing this as completed

If you still get the same error on altair>=5.5.0 (when it arrives) please feel free to comment here and I'll reopen for you

@rikardn
Copy link
Contributor Author

rikardn commented Nov 5, 2024

Thanks! I'll test the new version when available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants