Default CrewAI virtual environment - Conflict with Conda

I’ve been using a Conda environment with all necessary packages to run CrewAI since version 0.5. However, after upgrading to the latest version, I noticed that a default .venv folder is generated in my project directory.

Initially, this didn’t seem like an issue, but when I tried to install the agentops package, I encountered two problems:

  1. sys.path modification : When running crewai run, the command includes the <crewai_project>/.venv/.../site-packages directory in sys.path. However, it also removes the default directory of my Conda environment (<conda_env>/.../site-packages) from sys.path.

  2. Package installation issues : When running pip install agentops, the package is installed correctly in my Conda environment but not in the .venv environment created by CrewAI. Attempting to force-install on the .venv environment fails, as there is no pip command available in the /bin folder.

These issues make using CrewAI with Conda quite frustrating. I hope I’m missing something or that this issue will be resolved soon. In the meantime, I’ll have to explore alternative approaches and avoid using Conda with CrewAI.

For anyone interested, I found the following workaround to work in my case:

  • Go to the default .venv created by crewai
  • Edit the pyvenv.cfg with the following line:
    • include-system-site-packages = true

This will make the .venv of crewai use the agentops package installed on my conda environment (I remind that I couldnt install the agentops package on the .venv of crewai)

4 Likes

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