chessli
chessli copied to clipboard
pandas.errors.ParserError: Error tokenizing data. C error: Expected 10 fields in line 3, saw 11
I'm new to chessli, running it on MacOS. When I run chessli tactics ankify I get:
🔥 CHESSLI TACTICS 🔥
[22:36:48] INFO Fetching new puzzle activity... tactics.py:28
[22:36:57] INFO There are 176 new puzzles! tactics.py:95
INFO Trying to read the most up-to-date lichess puzzle database from tactics.py:38
https://database.lichess.org/lichess_db_puzzle.csv.bz2. This may take a few seconds...
Traceback (most recent call last):
File "/opt/homebrew/bin/chessli", line 8, in
any help is much appreciated
i can't install chessli, if anyone can help me please contact me on discord pls flex#3045
I had a similar problem on linux. This line tells you where the problem is:
File "/opt/homebrew/lib/python3.9/site-packages/chessli/tactics.py", line 41, in read_lichess_puzzle_database puzzle_df = pd.read_csv(url, names=column_names, compression="bz2")
Apparently lichess database file is not as pandas expects (last line says: pandas.errors.ParserError: Error tokenizing data. C error: Expected 10 fields in line 3, saw 11), because in some lines it has more columns. In order to tell pandas to only read 9 columns even if more are present i added in line 41 of this file "/opt/homebrew/lib/python3.9/site-packages/chessli/tactics.py" the following command:
usecols=range(0, len(column_names)),
So line 41 should be something like:
puzzle_df = pd.read_csv(url, names=column_names, usecols=range(0, len(column_names)), compression="bz2")
(sorry for my english)
I am developing a new simplified version of chessli with a graphical user interface. This error will be fixed soon :)