Fix #2409: Pin setuptools version to fix packaging.licenses dependency issue

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-03-20 02:35:31 +00:00
parent fe0813e831
commit 21a91f9998
3 changed files with 47 additions and 1 deletions

View File

@@ -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:

View File

@@ -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"

View File

@@ -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}"