Error message -- "ModuleNotFoundError: No module named 'chardet'"

114 views Asked by At

I'm new to Stack Overflow and also new to Python. So, please bear with me; this might seem like a simple question to you programming experts. :) I'm trying to run a wrapper script called katawrap on my Mac (Sonoma 14.3.1, MacBook Pro M1 Pro), but I keep encountering the following error message:

ls /Users/my_path/*.sgf \
| /Users/my_path/Katawrap/katawrap.py -visits 400 
/Users/my_path/katago/1.14.0/bin/katago analysis -config /Users/my_path/katago/1.14.0/share/katago/configs/gtp_example.cfg -model /Users/my_path/katago/1.14.0/share/katago/g170-b40c256x2-s5095420928-d1229425124.bin.gz \
result.jsonl
Traceback (most recent call last):
  File "/Users/*my_path*/katawrap.py", line 28, in <module>
    from katrain.sgf_parser import SGF
  File "/Users/*my_path*/Katawrap/katrain/sgf_parser.py", line 2, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'
PARSE ERROR: Argument: result.jsonl
Couldn't find a match for argument
Brief USAGE: analysis [-config <FILE>] ... [-model <FILE>] [...other flags...]
For complete USAGE and HELP, type: analysis -help

From this message, I gather that (1) I need to install the chardet module and (2) there's an issue with "result.jsonl" in my code. I believe I've installed chardet:

pip3 list
Package   Version
chardet   5.2.0
pip       24.0

Could the problem be related to the version of Python I'm using? What can I do to fix this issue and run the wrapper?

python3 --version
Python 3.12.2

pip list
Package    Version
altgraph   0.17.2
future     0.18.2
macholib   1.15.2
pip        24.0
setuptools 69.1.1
six        1.15.0
wheel      0.42.0
python --version
zsh: command not found: python

Thank you for your time. I appreciate it!

0

There are 0 answers