probberechts / soccerdata

⛏⚽ Scrape soccer data from Club Elo, ESPN, FBref, FiveThirtyEight, Football-Data.co.uk, FotMob, Sofascore, SoFIFA, Understat and WhoScored.
https://soccerdata.readthedocs.io/en/latest/
Other
544 stars 95 forks source link

Error when trying a simple call #389

Closed sgilliar37 closed 10 months ago

sgilliar37 commented 10 months ago

I'm just starting with soccerdata, but have a python and programming background. The code I'm having an issue with is:

import soccerdata as sd

fbref = sd.FBref()

player_season_stats = fbref.read_player_season_stats(stat_type="standard")

leagues = fbref.available_leagues()

print(leagues)

The error is happening on the 2nd line of code when calling fbref.

Traceback (most recent call last):

  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/steve/PycharmProjects/soccer/venv/lib/python3.9/site-packages/soccerdata/__init__.py", line 17, in <module>
    from .fbref import FBref
  File "/Users/steve/PycharmProjects/soccer/venv/lib/python3.9/site-packages/soccerdata/fbref.py", line 9, in <module>
    from lxml import etree, html
ImportError: dlopen(/Users/steve/PycharmProjects/soccer/venv/lib/python3.9/site-packages/lxml/etree.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'

Is this a version issue with installed packages? I have lxml installed for this project and it's worked for other projects that I've used it for. Could it be a conflict with a different version? Any help is greatly appreciated.

Steve

sgilliar37 commented 10 months ago

This issue was with pycharm, not with the installation of this package.