From 21a91f9998968c70766fccb099f88626e17a8816 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 02:35:31 +0000 Subject: [PATCH] Fix #2409: Pin setuptools version to fix packaging.licenses dependency issue Co-Authored-By: Joe Moura --- README.md | 5 +++ pyproject.toml | 2 +- .../test_dependency_compatibility.py | 41 +++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/installation/test_dependency_compatibility.py diff --git a/README.md b/README.md index b44ff6f4f..7dc641961 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,11 @@ If you encounter issues during installation or usage, here are some common solut - Try upgrading pip: `pip install --upgrade pip` - If issues persist, use a pre-built wheel: `pip install tiktoken --prefer-binary` +3. **ModuleNotFoundError: No module named 'packaging.licenses'** + - This error occurs when installing with `uv` due to newer setuptools versions + - Fix by downgrading setuptools: `pip install setuptools<=65.5.0` + - Then install CrewAI: `uv pip install crewai` + ### 2. Setting Up Your Crew with the YAML Configuration To create a new CrewAI project, run the following CLI (Command Line Interface) command: diff --git a/pyproject.toml b/pyproject.toml index 2e319e8d0..436d69554 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,5 +96,5 @@ exclude = ["cli/templates"] exclude_dirs = ["src/crewai/cli/templates"] [build-system] -requires = ["hatchling"] +requires = ["hatchling", "setuptools<=65.5.0"] build-backend = "hatchling.build" diff --git a/tests/installation/test_dependency_compatibility.py b/tests/installation/test_dependency_compatibility.py new file mode 100644 index 000000000..563990c50 --- /dev/null +++ b/tests/installation/test_dependency_compatibility.py @@ -0,0 +1,41 @@ +import subprocess +import sys +import os +import pytest +import shutil + + +def test_pypika_installation(): + """Test that pypika can be installed without packaging.licenses errors.""" + # Check if uv is available + uv_path = shutil.which("uv") + if not uv_path: + pytest.skip("UV not available, skipping test") + + # Install pypika using uv + result = subprocess.run( + ["uv", "pip", "install", "pypika==0.48.9", "--no-deps"], + capture_output=True, + text=True, + ) + assert result.returncode == 0, f"Failed to install pypika: {result.stderr}" + + +def test_chromadb_installation(): + """Test that chromadb can be installed without packaging.licenses errors.""" + # Skip this test if running in CI/CD to avoid long test times + if "CI" in os.environ: + pytest.skip("Skipping in CI environment") + + # Check if uv is available + uv_path = shutil.which("uv") + if not uv_path: + pytest.skip("UV not available, skipping test") + + # Install chromadb using uv + result = subprocess.run( + ["uv", "pip", "install", "chromadb>=0.5.23", "--no-deps"], + capture_output=True, + text=True, + ) + assert result.returncode == 0, f"Failed to install chromadb: {result.stderr}"