On the image on the left is my cursor ide with the terminal. Even though I am in the virtual environment named ‘golf’, I can’t see my opencv installed. On the right, I have opened regular terminal and I can see opencv in my virtual env.
The first two commands which python and echo $VIRTUAL_ENV have the same output in cursor vs regular terminal. The output of echo $PATH is different; cursor’s terminal has additional directory: /home/user/.cursor/extensions/ms-python.python-2024.12.3-linux-x64/python_files/deactivate/zsh.
The only solution that has worked for me is if I deactivate the environment (for each cursor terminal) and then reactivate again by sourcing the activate file in the virtual environment. Also, executing deactivate in cursor prints a warning message
grep: /home/user/.cursor/extensions/ms-python.python-2024.12.3-linux-x64/python_files/deactivate/zsh/envVars.txt: No such file or directory
grep: /home/user/.cursor/extensions/ms-python.python-2024.12.3-linux-x64/python_files/deactivate/zsh/envVars.txt: No such file or directory
grep: /home/user/.cursor/extensions/ms-python.python-2024.12.3-linux-x64/python_files/deactivate/zsh/envVars.txt: No such file or directory
Also, once I manually activate, the additional directory in $PATH no longer exists
which python, $PATH, $PYTHONHOME and all other commands seems to be identical but inside python we can see that the interpreter is not the one there.
(venv) ➜ app git:(main) ✗ python
Python 3.11.9 (main, Jan 27 2025, 10:02:36) [GCC 11.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import sys
print(“Using Python interpreter:”, sys.executable)
Using Python interpreter: /home/andre/app/cursor-0.45.11-build-250207y6nbaw5qc-x86_64.AppImage
Thanks for the detailed report. This is a known issue with Cursor’s terminal handling of virtual environments on Linux, specifically with AppImage installations
For now, the workaround for (deactivating and reactivating the venv) may be the best solution, if it works as hoped!
I’ve flagged this to the team, so I hope this will work better in future updates!
are there any news on that matter?
this issue makes cursor completely useless…
I can’t test my code on it, and have to jump between windows.
I have switched from VSCode and miss the good old times.
Any news on this issue? I have the same problem. Cursor seems to hijack the python binary path with a symlink and link it to the Appimage, which breaks the venv. To reveal the issue run ls -l venv/bin/python venv/bin/python3.