getcursor / cursor

The AI-powered code editor
https://cursor.sh
20.55k stars 1.38k forks source link

[Linux] Cannot use python scripts both in cursor IDE and Cursor Terminal : working command in system terminal does not work in cursor terminal, executable "sys.executable: /opt/cursor.appimage" replaces selected Python executable and blocks module imports #1484

Open MarArMar opened 3 weeks ago

MarArMar commented 3 weeks ago

I installed "lorem_text" python dependency

When I run a script using it, even when specifying the full path to my virtual env, cursor replaces the executable

If I print "sys.executable" it returns "/opt/cursor.appimage"

This is even with the executable correctly set in Cursor IDE, and all linters detecting the requirement

Step to reproduce on Linux :

Reproduction script :

import sys

print(f"sys.executable: {sys.executable}")

from lorem_text import lorem
❯ which python
/home/me/dev/PythonKit/.venv/bin/python
❯ which pip
/home/me/dev/PythonKit/.venv/bin/pip
❯ pip install lorem_text
Requirement already satisfied: lorem_text in ./.venv/lib/python3.11/site-packages (2.1)
Requirement already satisfied: Click>=7.0 in ./.venv/lib/python3.11/site-packages (from lorem_text) (8.1.7)
❯ /home/me/dev/PythonKit/.venv/bin/python /home/me/dev/PythonKit/app/scripts/contrib.py
sys.executable: /opt/cursor.appimage
Traceback (most recent call last):
  File "/home/me/dev/PythonKit/app/scripts/contrib.py", line 12, in <module>
    from lorem_text import lorem
ModuleNotFoundError: No module named 'lorem_text'

Operating System: TUXEDO OS 2 KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.114.0 Qt Version: 5.15.12 Kernel Version: 6.5.0-10040-tuxedo (64-bit) Graphics Platform: X11

MarArMar commented 3 weeks ago

The same command

/home/me/dev/PythonKit/.venv/bin/python /home/me/dev/PythonKit/app/scripts/contrib.py

Work in system terminal but not in cursor IDE terminal, which is SUPER abnormal

MarArMar commented 3 weeks ago

This is really blocking my workflow with Python on Cursor ATM