toddrob99 / MLB-StatsAPI

Python wrapper for MLB Stats API
GNU General Public License v3.0
539 stars 100 forks source link

dataclass() got an unexpected keyword argument 'kw_only' #119

Closed Mpellet771 closed 1 year ago

Mpellet771 commented 1 year ago

I'm using the command print('Phillies 40-man roster on opening day of the 2018 season:\n%s' % statsapi.roster(143,'40Man',date=statsapi.get('season',{'seasonId':2018,'sportId':1})['seasons'][0]['regularSeasonStartDate']))

After trying my own code, and I'm getting this error (personal info redacted): Traceback (most recent call last): \Baseball\Python\BaseballScrape.py", line 3, in import mlbstatsapi File "AppData\Roaming\Python\Python39\site-packages\mlbstatsapi__init.py", line 1, in from .mlb_api import Mlb File "\Roaming\Python\Python39\site-packages\mlbstatsapi\mlb_api.py", line 6, in from mlbstatsapi.models.people import Person, Player, Coach File "AppData\Roaming\Python\Python39\site-packages\mlbstatsapi\models\people\init__.py", line 2, in from .people import Player, Coach, Person, Batter, Pitcher, DraftPick File "AppData\Roaming\Python\Python39\site-packages\mlbstatsapi\models\people\people.py", line 163, in @dataclass(kw_only=True) TypeError: dataclass() got an unexpected keyword argument 'kw_only'

Is it an installation issue?

toddrob99 commented 1 year ago

You're importing mlbstatsapi, which is a different package than this one (this package is import statsapi).

Mpellet771 commented 1 year ago

Oh! I apologize for my confusion.Marianne Sent from my iPhoneOn Jun 19, 2023, at 10:06 PM, Todd Roberts @.***> wrote: You're importing mlbstatsapi, which is a different package than this one (this package is import statsapi).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>