Issue report / when importing sb
SebaCrespo10 opened this issue · 3 comments
SebaCrespo10 commented
Contact Details
Version
1.0.1
What platform are you seeing the problem on?
Windows
What Python version are you running, are you using a virtual environment? Give us as much info as you can.
python 3.8
What happened?
When importig sb i got the following error.
from statsbombpy import sb
Relevant log output
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Input In [9], in <cell line: 5>()
2 import numpy as np
3 import matplotlib.pyplot as plt
----> 5 from statsbombpy import sb
File ~/opt/anaconda3/lib/python3.9/site-packages/statsbombpy/sb.py:9, in <module>
7 from statsbombpy import api_client, public
8 from statsbombpy.config import DEFAULT_CREDS, PARALLELL_CALLS_NUM
----> 9 from statsbombpy.helpers import (
10 filter_and_group_events,
11 merge_events_and_frames,
12 reduce_events,
13 )
16 def competitions(fmt="dataframe", creds: dict = DEFAULT_CREDS):
17 if api_client.has_auth(creds) is True:
File ~/opt/anaconda3/lib/python3.9/site-packages/statsbombpy/helpers.py:3, in <module>
1 from collections import defaultdict
----> 3 import inflect
4 import pandas as pd
5 from joblib import Memory
File ~/opt/anaconda3/lib/python3.9/site-packages/inflect/__init__.py:76, in <module>
60 from typing import (
61 Dict,
62 Union,
(...)
71 Any,
72 )
73 from numbers import Number
---> 76 from pydantic import Field, validate_arguments
77 from pydantic.typing import Annotated
80 class UnknownClassicalModeError(Exception):
File ~/opt/anaconda3/lib/python3.9/site-packages/pydantic/__init__.py:2, in init pydantic.__init__()
File ~/opt/anaconda3/lib/python3.9/site-packages/pydantic/dataclasses.py:46, in init pydantic.dataclasses()
File ~/opt/anaconda3/lib/python3.9/site-packages/pydantic/main.py:121, in init pydantic.main()
TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'
Code to reproduce issue
No response
Attempted solutions
No response
WillTGM commented
Hi, thanks for getting in touch.
Could you:
- Try with Python version
3.8
? Your stack trace suggests you're using3.9
and we haven't tested above3.8
. - Upgrade your version of
statsbombpy
to the latest version, which should be1.6.1
rather than using1.0.1
. - Can you check what version of
pydantic
you are using? There have been some recent issues with a new release, which might be the root cause here.
Thanks.
SebaCrespo10 commented
Thanks,
I am using latest version of statsbombpy and pydantic 1.10.4.
Using Python 3.8 solved the problem. Thanks!
WillTGM commented
Great. Glad that solved it.