PraisonAI icon indicating copy to clipboard operation
PraisonAI copied to clipboard

pip install errors (versions)

Open junaid3d opened this issue 1 year ago • 6 comments

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. opentelemetry-exporter-otlp-proto-http 1.23.0 requires opentelemetry-exporter-otlp-proto-common==1.23.0, but you have opentelemetry-exporter-otlp-proto-common 1.29.0 which is incompatible. opentelemetry-exporter-otlp-proto-http 1.23.0 requires opentelemetry-proto==1.23.0, but you have opentelemetry-proto 1.29.0 which is incompatible. opentelemetry-exporter-otlp-proto-http 1.23.0 requires opentelemetry-sdk~=1.23.0, but you have opentelemetry-sdk 1.29.0 which is incompatible. gradio-client 0.14.0 requires websockets<12.0,>=10.0, but you have websockets 14.1 which is incompatible. crewai 0.22.5 requires langchain-openai<0.0.6,>=0.0.5, but you have langchain-openai 0.1.7 which is incompatible. crewai 0.22.5 requires python-dotenv==1.0.0, but you have python-dotenv 1.0.1 which is incompatible.

junaid3d avatar Dec 25 '24 15:12 junaid3d

conda or os python ?

malv-c avatar Dec 25 '24 17:12 malv-c

Python 3.10.11 Windows 10

junaid3d avatar Dec 25 '24 18:12 junaid3d

installed in its own virtual env

junaid3d avatar Dec 25 '24 18:12 junaid3d

tried also -- impossible to get running

jasonkneen avatar Jan 01 '25 16:01 jasonkneen

@claude review this request

MervinPraison avatar May 28 '25 14:05 MervinPraison

Claude finished @MervinPraison's task —— View job


Dependency Conflict Analysis Complete

Todo List:

  • [x] Read repository setup instructions (CLAUDE.md)
  • [x] Examine project dependency files
  • [x] Analyze specific version conflicts
  • [x] Research package compatibility issues
  • [x] Provide recommendations for resolution

🔍 Root Cause Analysis

The dependency conflicts stem from outdated package versions being installed rather than the versions specified in PraisonAI's current requirements. Here's the breakdown:

1. CrewAI Version Mismatch

  • Issue: User has crewai==0.22.5 installed
  • Expected: PraisonAI specifies crewai>=0.32.0 in pyproject.toml:87
  • Conflicts:
    • CrewAI 0.22.5 requires langchain-openai<0.0.6,>=0.0.5
    • PraisonAI requires langchain-openai>=0.2.1,<0.3.0

2. WebSockets Version Issue

  • Issue: User has websockets==14.1
  • Expected: PraisonAI specifies websockets>=12.0 in pyproject.toml:71
  • Conflict: gradio-client==0.14.0 requires websockets<12.0,>=10.0

3. Python-dotenv Precision Issue

  • Issue: crewai==0.22.5 requires exact version python-dotenv==1.0.0
  • Installed: python-dotenv==1.0.1
  • PraisonAI: Allows python-dotenv>=1.0.1 in requirements.txt:4

4. OpenTelemetry Dependencies

  • These are not directly specified by PraisonAI
  • Likely pulled in by transitive dependencies (e.g., litellm, monitoring tools)
  • Version mismatches between different OpenTelemetry packages

🛠️ Recommended Solutions

Immediate Fix (For Users)

# 1. Create fresh virtual environment
python -m venv fresh_praisonai_env
source fresh_praisonai_env/bin/activate  # On Windows: fresh_praisonai_env\Scripts\activate

# 2. Upgrade pip
python -m pip install --upgrade pip

# 3. Install PraisonAI with specific extras (choose based on needs)
pip install "praisonai[crewai]>=2.2.16"
# OR for full installation:
pip install "praisonai[all]>=2.2.16"

Alternative: Force Upgrade Existing Environment

# Upgrade core packages first
pip install --upgrade crewai>=0.32.0
pip install --upgrade "langchain-openai>=0.2.1,<0.3.0"
pip install --upgrade "websockets>=12.0"
pip install --upgrade "python-dotenv>=1.0.1"

# Then reinstall PraisonAI
pip install --upgrade --force-reinstall praisonai

📋 Long-term Recommendations for Repository

1. Add Version Upper Bounds

Consider adding upper bounds to prevent future conflicts:

websockets = ">=12.0,<15.0"  # Instead of just ">=12.0"

2. Pin OpenTelemetry Versions

If OpenTelemetry is needed, add explicit constraints:

opentelemetry-sdk = "~=1.29.0"
opentelemetry-exporter-otlp-proto-common = "~=1.29.0"
opentelemetry-proto = "~=1.29.0"

3. Add Dependency Groups

Consider separating monitoring dependencies:

monitoring = [
    "opentelemetry-api~=1.29.0",
    "opentelemetry-sdk~=1.29.0"
]

4. Update Installation Documentation

Add troubleshooting section for dependency conflicts with fresh environment recommendation.


💡 Why This Happens

This is a common issue with Python packages that have overlapping dependency trees but specify different version ranges. The conflicts occur because:

  1. Transitive dependencies bring in packages not directly specified
  2. Older versions of packages (like CrewAI 0.22.5) have stricter constraints
  3. Pip's resolver cannot find compatible versions across all constraints

The solution is ensuring users install the current package specifications rather than cached/older versions.


claude[bot] avatar May 28 '25 14:05 claude[bot]

@junaid3d thanks for your contribution. Please upgrade to the latest version and let me know if its working. Please reopen this issue if it comes again. Thank you

MervinPraison avatar May 30 '25 09:05 MervinPraison