Build failed at creating venv virtual environment: `VIRTUAL_ENV=/Users/xxxxx/crew_agent/venv-3.11` does not match the project environment path `.venv` and will be ignored

I was following the crew ai tutorial and these are the steps that I have done:

  1. Create and activate a python virtual environment, version is 3.11.9
  2. Install crewai and crewai tools
  3. Create latest-ai-development project
  4. Go into the project directory and run crewai install

I got the following error message:

Running the Crew
warning: `VIRTUAL_ENV=/Users/jisonz/crew_agent/venv-3.11` does not match the project environment path `.venv` and will be ignored
Using CPython 3.13.0 interpreter at: /opt/homebrew/opt/python@3.13/bin/python3.13
Creating virtual environment at: .venv
   Built latest-ai-development @ file:///Users/jisonz/crew_agent/latest_ai_development                                                                                                                 × Failed to download and build `tiktoken==0.7.0`
  ╰─▶ Build backend failed to build wheel through `build_wheel` (exit status: 1)

      [stdout]
      running bdist_wheel
      running build
      running build_py
      copying tiktoken/registry.py -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken
      copying tiktoken/__init__.py -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken
      copying tiktoken/core.py -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken
      copying tiktoken/model.py -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken
      copying tiktoken/load.py -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken
      copying tiktoken/_educational.py -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken
      copying tiktoken_ext/openai_public.py -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken_ext
      running egg_info
      writing tiktoken.egg-info/PKG-INFO
      writing dependency_links to tiktoken.egg-info/dependency_links.txt
      writing requirements to tiktoken.egg-info/requires.txt
      writing top-level names to tiktoken.egg-info/top_level.txt
      reading manifest file 'tiktoken.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'tiktoken.egg-info/SOURCES.txt'
      copying tiktoken/py.typed -> build/lib.macosx-14.0-arm64-cpython-313/tiktoken
      running build_ext
      running build_rust

      [stderr]
      warning: no files found matching 'Makefile'
      cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib -- -C link-args=-undefined
      dynamic_lookup -Wl,-install_name,@rpath/_tiktoken.cpython-313-darwin.so
             Fresh once_cell v1.20.2
             Fresh autocfg v1.4.0
             Fresh unicode-ident v1.0.14
             Fresh memchr v2.7.4
             Fresh regex-syntax v0.8.5
             Fresh heck v0.4.1
             Fresh cfg-if v1.0.0
             Fresh scopeguard v1.2.0
             Fresh target-lexicon v0.12.16
             Fresh aho-corasick v1.1.3
             Fresh smallvec v1.13.2
             Fresh bit-vec v0.6.3
             Fresh indoc v2.0.5
             Fresh unindent v0.2.3
             Fresh proc-macro2 v1.0.92
             Fresh libc v0.2.164
             Fresh regex-automata v0.4.9
             Fresh bit-set v0.5.3
             Fresh rustc-hash v1.1.0
             Dirty pyo3-build-config v0.20.3: the env variable PYO3_PYTHON changed
         Compiling pyo3-build-config v0.20.3
             Fresh quote v1.0.37
             Fresh lock_api v0.4.12
             Fresh parking_lot_core v0.9.10
             Fresh memoffset v0.9.1
             Fresh regex v1.11.1
             Fresh portable-atomic v1.10.0
             Fresh bstr v1.11.0
           Running `/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/build/pyo3-build-config-cd3523dd74b1ae30/build-script-build`
             Fresh syn v2.0.89
             Fresh parking_lot v0.12.3
             Fresh fancy-regex v0.11.0
           Running `rustc --crate-name pyo3_build_config --edition=2021 /Users/jisonz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-build-config-0.20.3/src/lib.rs
      --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off
      --cfg 'feature="default"' --cfg 'feature="extension-module"' --cfg 'feature="resolve-config"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("abi3",
      "abi3-py310", "abi3-py311", "abi3-py312", "abi3-py37", "abi3-py38", "abi3-py39", "default", "extension-module", "python3-dll-a", "resolve-config"))' -C
      metadata=895e3f1014fa4553 -C extra-filename=-895e3f1014fa4553 --out-dir /Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps
      -C strip=debuginfo -L dependency=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps --extern
      once_cell=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libonce_cell-1865a5ac6aa204a1.rmeta --extern
      target_lexicon=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libtarget_lexicon-e03c1c2f8fe8d2f5.rmeta --cap-lints allow`
             Dirty pyo3-macros-backend v0.20.3: dependency info changed
         Compiling pyo3-macros-backend v0.20.3
           Running `rustc --crate-name pyo3_macros_backend --edition=2021 /Users/jisonz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-macros-backend-0.20.3/src/lib.rs
      --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no '--warn=clippy::useless_transmute'
      '--warn=clippy::used_underscore_binding' --warn=unused_lifetimes --allow=unused_imports '--warn=clippy::unnecessary_wraps' '--warn=clippy::todo' --warn=rust_2021_prelude_collisions
      --warn=rust_2018_idioms '--warn=clippy::manual_ok_or' '--warn=clippy::manual_assert' '--warn=clippy::let_unit_value' --warn=invalid_doc_attributes '--warn=clippy::flat_map_option'
      '--warn=clippy::filter_map_next' '--warn=clippy::explicit_iter_loop' '--warn=clippy::explicit_into_iter_loop' --warn=elided_lifetimes_in_paths --allow=dead_code '--warn=clippy::dbg_macro'
      '--warn=clippy::checked_conversions' '--warn=rustdoc::broken_intra_doc_links' '--warn=rustdoc::bare_urls' -C debug-assertions=off --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature,
      values())' -C metadata=e169bd5d53b343bf -C extra-filename=-e169bd5d53b343bf --out-dir /Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps
      -C strip=debuginfo -L dependency=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps --extern
      heck=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libheck-802cc21bfd88cb00.rmeta --extern
      proc_macro2=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libproc_macro2-a6cf0d6ca8bc4d10.rmeta --extern
      pyo3_build_config=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libpyo3_build_config-895e3f1014fa4553.rmeta
      --extern quote=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libquote-8fa66af772876256.rmeta --extern
      syn=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libsyn-ceb29939c6bd0bfa.rmeta --cap-lints allow`
             Dirty pyo3-ffi v0.20.3: dependency info changed
         Compiling pyo3-ffi v0.20.3
             Dirty pyo3 v0.20.3: dependency info changed
         Compiling pyo3 v0.20.3
           Running `rustc --crate-name build_script_build --edition=2021 /Users/jisonz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-ffi-0.20.3/build.rs
      --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no '--warn=clippy::useless_transmute'
      '--warn=clippy::used_underscore_binding' --warn=unused_lifetimes --allow=unused_imports '--warn=clippy::unnecessary_wraps' '--warn=clippy::todo' --warn=rust_2021_prelude_collisions
      --warn=rust_2018_idioms '--warn=clippy::manual_ok_or' '--warn=clippy::manual_assert' '--warn=clippy::let_unit_value' --warn=invalid_doc_attributes
      '--warn=clippy::flat_map_option' '--warn=clippy::filter_map_next' '--warn=clippy::explicit_iter_loop' '--warn=clippy::explicit_into_iter_loop' --warn=elided_lifetimes_in_paths
      --allow=dead_code '--warn=clippy::dbg_macro' '--warn=clippy::checked_conversions' '--warn=rustdoc::broken_intra_doc_links' '--warn=rustdoc::bare_urls' -C
      debug-assertions=off --cfg 'feature="default"' --cfg 'feature="extension-module"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("abi3", "abi3-py310",
      "abi3-py311", "abi3-py312", "abi3-py37", "abi3-py38", "abi3-py39", "default", "extension-module", "generate-import-lib"))' -C metadata=b54be801e364989b -C
      extra-filename=-b54be801e364989b --out-dir /Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/build/pyo3-ffi-b54be801e364989b
      -C strip=debuginfo -L dependency=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps --extern
      pyo3_build_config=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libpyo3_build_config-895e3f1014fa4553.rlib --cap-lints allow`
           Running `rustc --crate-name build_script_build --edition=2021 /Users/jisonz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.20.3/build.rs
      --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no '--warn=clippy::useless_transmute'
      '--warn=clippy::used_underscore_binding' --warn=unused_lifetimes --allow=unused_imports '--warn=clippy::unnecessary_wraps' '--warn=clippy::todo' --warn=rust_2021_prelude_collisions
      --warn=rust_2018_idioms '--warn=clippy::manual_ok_or' '--warn=clippy::manual_assert' '--warn=clippy::let_unit_value' --warn=invalid_doc_attributes '--warn=clippy::flat_map_option'
      '--warn=clippy::filter_map_next' '--warn=clippy::explicit_iter_loop' '--warn=clippy::explicit_into_iter_loop' --warn=elided_lifetimes_in_paths --allow=dead_code
      '--warn=clippy::dbg_macro' '--warn=clippy::checked_conversions' '--warn=rustdoc::broken_intra_doc_links' '--warn=rustdoc::bare_urls' -C debug-assertions=off --cfg
      'feature="default"' --cfg 'feature="extension-module"' --cfg 'feature="indoc"' --cfg 'feature="macros"' --cfg 'feature="pyo3-macros"' --cfg 'feature="unindent"' --check-cfg
      'cfg(docsrs)' --check-cfg 'cfg(feature, values("abi3", "abi3-py310", "abi3-py311", "abi3-py312", "abi3-py37", "abi3-py38", "abi3-py39", "anyhow", "auto-initialize",
      "chrono", "default", "either", "experimental-inspect", "extension-module", "eyre", "full", "generate-import-lib", "hashbrown", "indexmap", "indoc", "inventory",
      "macros", "multiple-pymethods", "nightly", "num-bigint", "num-complex", "pyo3-macros", "rust_decimal", "serde", "smallvec", "unindent"))' -C metadata=700077d4216b1689
      -C extra-filename=-700077d4216b1689 --out-dir /Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/build/pyo3-700077d4216b1689
      -C strip=debuginfo -L dependency=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps --extern
      pyo3_build_config=/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/deps/libpyo3_build_config-895e3f1014fa4553.rlib --cap-lints allow`
           Running `/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/build/pyo3-ffi-b54be801e364989b/build-script-build`
      error: failed to run custom build command for `pyo3-ffi v0.20.3`

      Caused by:
        process didn't exit successfully: `/Users/jisonz/.cache/uv/sdists-v6/pypi/tiktoken/0.7.0/SmsYiP7MlBJP2fjbNxDkF/src/target/release/build/pyo3-ffi-b54be801e364989b/build-script-build` (exit
      status: 1)
        --- stdout
        cargo:rerun-if-env-changed=PYO3_CROSS
        cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
        cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
        cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
        cargo:rerun-if-env-changed=PYO3_USE_ABI3_FORWARD_COMPATIBILITY

        --- 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
        = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
      warning: build failed, waiting for other jobs to finish...
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib -- -C 'link-args=-undefined
      dynamic_lookup -Wl,-install_name,@rpath/_tiktoken.cpython-313-darwin.so'` failed with code 101

  help: `tiktoken` (v0.7.0) was included because `latest-ai-development` (v0.1.0) depends on `crewai` (v0.83.0) which depends on `litellm` (v1.52.16) which depends on `tiktoken`
An error occurred while running the crew: Command '['uv', 'run', 'run_crew']' returned non-zero exit status 1.

Does anyone know how to solve this?

You have currently two Python versions installed on your computer.

This line says that you’re using Python interpreter v3.13.0. Although you installed Python v3.11.9, you’re using a newer interpreter when running commands, which is not compatible with CrewAI.

If you’re using Visual Studio Code, then change the Python interpreter as follows:

  1. Press Ctrl + Shift + P on Windows or + + P on Mac.
  2. Type the following command: > Python: Select Interpreter
  3. Choose the Python interpreter v3.11.9.
1 Like

@rokbenko thank you, your solution worked for me

@MarcusL11 You’re welcome! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.