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

beartype error #4

Closed
yxc8 opened this issue Dec 8, 2022 · 2 comments
Closed

beartype error #4

yxc8 opened this issue Dec 8, 2022 · 2 comments

Comments

@yxc8
Copy link

yxc8 commented Dec 8, 2022

Hi,

I get the following error complaining about beartype import, when running !pipenv run python3 -m src.testset --train-set train.jsonl --days 2 --output-path 'out/' --seed 42

Any suggestion on how to fix this?

Thanks!

Traceback (most recent call last):
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/yc/Desktop/kaggle/sample/recsys-dataset/src/testset.py", line 8, in
from beartype import beartype
File "/Users/yc/.local/share/virtualenvs/recsys-dataset-XXnHBDKs/lib/python3.9/site-packages/beartype/init.py", line 57, in
from beartype._decor.decormain import beartype
File "/Users/yc/.local/share/virtualenvs/recsys-dataset-XXnHBDKs/lib/python3.9/site-packages/beartype/_decor/decormain.py", line 24, in
from beartype._data.datatyping import (
File "/Users/yc/.local/share/virtualenvs/recsys-dataset-XXnHBDKs/lib/python3.9/site-packages/beartype/_data/datatyping.py", line 129, in
BeartypeReturn = Union[BeartypeableT, BeartypeConfedDecorator]
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 243, in inner
return func(*args, **kwds)
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 316, in getitem
return self._getitem(self, parameters)
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 421, in Union
parameters = _remove_dups_flatten(parameters)
File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 215, in _remove_dups_flatten
all_params = set(params)
TypeError: unhashable type: 'list'

@yxc8
Copy link
Author

yxc8 commented Dec 8, 2022

Following up on this, it seems like using python3.10 instead of python3.9 avoids this problem. Not sure why the python3.9 won't work.

@philippnormann
Copy link
Member

Hi @yxc8, thanks for your feedback! This issue is a known CPython issue (#42965) resolved in 3.9.2. See this beartype issue for more context. As you have already discovered, the solution is to use a Python version >= 3.9.2. I would like to integrate this minimum version requirement for our Python version into our Pipenv, but unfortunately, this is currently not supported.

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

No branches or pull requests

2 participants