When you install crewAI you get the libraries added to the current active virtual-env, as it should be.
But then when you create a crewAI project, you get a second virtual-env at the project level.
Because of this, if you ever update the active environment with a new version of crewAI then the second virtual-env at the project level gets out of sync. And you get the obnoxious warning: VIRTUAL_ENV=/.... does not match the project environment path .venvand will be ignored; use–active` to target the active environment instead
Hi Alfred, I haven’t run into this problem before. Are you getting this issue when using crewai CLI commands or you are using other methods to run your crews?
@zinyando
The problem is when I use the CrewAI CLI. I have a virtual env. before installing crewAI ( .venv_crewai ) and then crewAI will create a new virtual env. inside the project ( .venv ) . Is it expected to end up with these two virtual envs?
I am facing the similar issue since last 2 days. I do not understand the root folder is marked as .venv (library root) with Python 3.12.4 but whenever I run “crewai create crew my_crew”, it is created correctly with proper folder structure. However when I do “crewai run” it is creating another .venv file within that project with python version 3.13. Because I could see , in Environmental Variables, I have mentioned 3.13\scripts and 3.12\scripts respectively. On searching further I could understand that when “crewai run” command is executed, UV is creating a new .venv ignoring its root .venv. And since the project level .venv and root level .venv are mismatched, on running I am getting a warning every time followed by an error message throwing that ‘nomodulefounderror’. Kindly suggest what to do! Is there any issue keeping multiple python versions in my system! I had to install another version (python 3.12) since one of my applications does not allow 3.13 version support, so I have to keep both the version. My IDE is Pycharm.
I have run my crew many times, some even successfully , and no additional virtual environments were ever created (unless maybe they were discarded immediately after the run). However, when uv creates and populates a virtual environment there is a fair amount of output that would be difficult to miss (unless maybe crewai is suppressing the uv output). I added a sleep to my crew and once the crew was running (and paused on the sleep) I used find to locate any virtual environments anywhere in my project and it found only the one .venv at the root.
When you were creating your project did you perhaps start with an already existing project and maybe that project had a virtual environment already? I’m wondering where your .venv_crewai environment came from as I have not seen that before.
Note: I use the astral-uv snap as it looks like it is maintained by the uv team at Astral and it seemed current the last time I checked and of course snaps auto-update and for me at least, they just work.