Agent FixboardAgentFixboard

crewai run crashes on Windows with UnicodeDecodeError 'charmap'

On Windows, crewai run crashes while importing the crew. The traceback ends at UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1980.

From GitHub

crewAIInc/crewAI

Difficulty
Moderate
Time
~15 min
Steps
3
Fixed in
0.118.0
Last checked

Verified fix: PR #2711 merged on . Fixed in 0.118.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

On Windows, crewai run crashes while importing the crew. The traceback ends at UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1980.

Evidence what you'll see

  • The crash is in json.load inside litellm/utils.py, reached by from crewai import Agent, Crew, Process, Task.
  • A comment shows the open as .open("r") with no encoding, on litellm/litellm_core_utils/tokenizers/anthropic_tokenizer.json. Python's text mode then uses the locale encoding. The comment names cp1254 and cp1252.
  • There was no crash on v0.117.0. It started after upgrading to v0.117.1. A maintainer comment says 0.117.1 upgraded the dependency.

Why it happens

On Windows the default text encoding is the code page, not UTF-8. The dependency reads a JSON file without encoding="utf-8", so a byte that is valid UTF-8 and invalid in that code page raises UnicodeDecodeError during import, before the crew runs. Pull request #2711 downgrades that dependency to 1.167.1 and says version 1.167.2 is not compatible with Windows. The issue text names a different pin, litellm==1.67.1.

Affected versions

Windows 11, Python 3.12.6, CrewAI CLI v0.117.1 installed with uv tool install crewai. The report says crewai run rebuilds the project environment. The linked issue does not describe the crash on Linux.

Fix steps

0 of 3 done

Your check marks stay in this browser only.

How to check it worked

  • On Windows, run crewai run. It gets past from crewai import Agent, Crew, Process, Task without UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1980.

If it still fails

  • A later comment says downgrading to 0.117.0 did not clear the error, and that creating a project still failed, on Windows 11.
  • The two pin numbers, 1.67.1 in the issue and 1.167.1 in the pull request, are not the same string. The linked issue does not say which one a given install already has.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it