Installation issues Python 3.13

Despite the official CrewAI installation instructions indicating Python >=3.10 <=3.13,
command “pip install crewai” fails at dependency tiktoken, attempts to build tiktoken-0.7.0, which does not build on Python 3.13, pyo3 version not supported.

Perhaps a dependency bump to tiktoken-0.8.0 (released Oct 4th) might help?

Error message indicated:


Building wheels for collected packages: tiktoken
Building wheel for tiktoken (pyproject.toml) … error
error: subprocess-exited-with-error

× Building wheel for tiktoken (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [130 lines of output]

error: failed to run custom build command for pyo3-ffi v0.20.3

  Caused by:
    process didn't exit successfully: `C:\Users\<username>\AppData\Local\Temp\pip-install-7lov9mzv\tiktoken_d3c10f57e5a044198ab2f2605f76cf80\target\release\build\pyo3-ffi-4512adfd46cc9bfd\build-script-build` (exit code: 1)

— stderr
error: the configured Python interpreter version (3.13) is newer than PyO3’s maximum supported version (3.12)
= help: please check if an updated version of PyO3 is available. Current version: 0.20.3
odule --crate-type cdylib --` failed with code 101
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.roblem with pip.
ERROR: Failed building wheel for tiktoken
Failed to build tiktoken ml based projects (tiktoken)
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (tiktoken)

This is a dependency rabbit hole for new users, who are likely to want the most up to date versions of tools, this may present a barrier to adoption.

For Visual Studio Code (PowerShell terminal), the following commands allowed the build of tiktoken-0.7.0 to succeed:

$env:PYO3_USE_ABI3_FORWARD_COMPATIBILITY = "1"
pip install crewai

It’s too early to say if this is a good idea at all or if it will break anything, but it’s one less hurdle.

Good luck all!

3 Likes

For me it only worked when I downgraded to python 3.12.8

1 Like

Didn’t work for me. My python version is 3.13 and Visual Studio Code version is 1.95.2

1 Like

I tried this as well. Did not work. So I am stuck in the same depndency problem with python 3.13.1 on MAC.

This worked for me. Thank you

We updated the docs to show the stable python versions to use with CrewAI Python >=3.10 and <3.13

TLDR: v 3.13 is unstable and will throw the pyo3 error from tiktoken package, so do not use it.