New python environment issue in 0.45.15

I use pyenv and poetry to keep track of python versions and packages. And I use zsh.

With the 0.45.15 update I’m suddenly getting issues when trying to run python commands. Previously I have just told cursor to run commands using poetry run ... and everything works.

I get this error:

➜ poetry run pytest -v videostream/tests/
Python path configuration:
  PYTHONHOME = '/tmp/.mount_cursorVgV595/usr/'
  PYTHONPATH = '/tmp/.mount_cursorVgV595/usr/share/pyshared/:'
  program name = '/home/richard/.local/share/pypoetry/venv/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/home/richard/.local/share/pypoetry/venv/bin/python'
  sys.base_prefix = '/tmp/.mount_cursorVgV595/usr'
  sys.base_exec_prefix = '/tmp/.mount_cursorVgV595/usr'
  sys.executable = '/home/richard/.local/share/pypoetry/venv/bin/python'
  sys.prefix = '/tmp/.mount_cursorVgV595/usr'
  sys.exec_prefix = '/tmp/.mount_cursorVgV595/usr'
  sys.path = [
    '/tmp/.mount_cursorVgV595/usr/share/pyshared/',
    '',
    '/tmp/.mount_cursorVgV595/usr/lib/python38.zip',
    '/tmp/.mount_cursorVgV595/usr/lib/python3.8',
    '/tmp/.mount_cursorVgV595/usr/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f662989d740 (most recent call first):
<no Python frame>

I am using python 3.10 in my project and this is probably occuring because it’s using an old version of python (3.8).

I can resolve this by doing this:

unset PYTHONHOME PYTHONPATH && poetry run pytest -v

And everything works like before.

I’m guessing cursor started doing something to try to help the users with python environments?

2 Likes

I have the same problem. Calling python it self leads to this error.
I’m using Ubuntu 20.04.

Same problem for me, no matter which poetry command I run from integrated terminal it fails with mentioned error. If I try from ubuntu terminal it works just fine.

exactly the same issue here with Python 3.10 - it works fine from an Ubuntu terminal window. I’m running Cursor 0.45.14 and getting this error.

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