# Cursor 0.46.0 adds $PYTHONHOME to env with wrong value

**URL:** <https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714>\
**Category:** Bug Reports\
**Created:** [February 21, 2025, 7:50am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714 "2025-02-21T07:50:25Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![buttercrab](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/buttercrab/32/28043_2.png) [@buttercrab](https://forum.cursor.com/u/buttercrab)\
**Post date:** [February 21, 2025, 7:50am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/1 "2025-02-21T07:50:26Z")

</div>

Version:

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/1/f/1f4900a919df584d73d3f15b353905f5550dd358.png)

```auto
➜ echo $PYTHONHOME
/tmp/.mount_cursoroNCRSv/usr/

```

When I look into `$PYTHONHOME`, it is a wrong value. It breaks lots of things starting from python

```auto
➜ python3
Fatal Python error: Failed to import encodings module
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

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

```

Please fix this. Thank you.

---

<div class="post-metadata">

**Author:** ![holyzing](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/holyzing/32/28127_2.png) [@holyzing](https://forum.cursor.com/u/holyzing)\
**Post date:** [February 21, 2025, 12:59pm UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/2 "2025-02-21T12:59:55Z")

</div>

Version: 0.46.0  
VSCode Version: 1.96.2  
Commit: aff57e1d9a74ed627fb5bd393e347079514436a0  
Date: 2025-02-21T04:49:24.841Z  
Electron: 32.2.6  
Chromium: 128.0.6613.186  
Node.js: 20.18.1  
V8: 12.8.374.38-electron.0  
OS: Linux x64 5.10.0-23-amd64

```auto
env | grep PYTHONHOME
PYTHONHOME=/tmp/.mount_cursorhmX5gQ/usr/

```

---

<div class="post-metadata">

**Author:** ![holyzing](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/holyzing/32/28127_2.png) [@holyzing](https://forum.cursor.com/u/holyzing)\
**Post date:** [February 21, 2025, 1:11pm UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/3 "2025-02-21T13:11:08Z")

</div>

Download and install again from the official website, do not use the check for update feature in the IDE to update

---

<div class="post-metadata">

**Author:** ![HamzaFarhan](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/hamzafarhan/32/13612_2.png) [@HamzaFarhan](https://forum.cursor.com/u/HamzaFarhan)\
**Post date:** [February 21, 2025, 9:32pm UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/4 "2025-02-21T21:32:17Z")

</div>

But that downgrades cursor. Any workaround that would let us keep 0.46.0?

---

<div class="post-metadata">

**Author:** ![Kirai](https://avatars.discourse-cdn.com/v4/letter/k/fbc32d/32.png) [@Kirai](https://forum.cursor.com/u/Kirai)\
**Post date:** [February 22, 2025, 7:28am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/5 "2025-02-22T07:28:49Z")

</div>

There is definitely something wrong with how paths are handled. I managed to [solve it in the launcher](https://forum.cursor.com/t/installing-command-line-launcher-on-linux/7151/6), but today I hit the issue with python too and I am a bit afraid much more things got broken, waiting to be discovered.

---

<div class="post-metadata">

**Author:** ![asarama](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@asarama](https://forum.cursor.com/u/asarama)\
**Post date:** [February 24, 2025, 2:23am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/6 "2025-02-24T02:23:58Z")

</div>

This didn’t work for me…

---

<div class="post-metadata">

**Author:** ![asarama](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@asarama](https://forum.cursor.com/u/asarama)\
**Post date:** [February 24, 2025, 3:27am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/7 "2025-02-24T03:27:18Z")

</div>

Good workaround here:

> <https://github.com/getcursor/cursor/issues/2734>
>
> \> NOTE: We will try our best to check Github Issues, but \[forum.cursor.com\](http…s://forum.cursor.com/) is our main site for bug reports / user feedback. We'd recommend you post there for the fastest response.
> 
> ACK: I will post this on the forums as well, its pretty critical in the Linux Build.
> 
> EDIT: On the forums: https://forum.cursor.com/t/python-environment-issues-on-linux-appimage/53002
> 
> EDIT EDIT: The forum link is dead due to the spam filter banning my account from making any posts over cross posting this.
> 
> !\[Image\](https://github.com/user-attachments/assets/60305309-e4be-429a-b5e6-9a903c74377b)
> 
> !\[Image\](https://github.com/user-attachments/assets/976159a3-3217-4acf-8602-2fd821a46091)
> 
> EDIT EDIT EDIT: Got banned from the forums over reporting this issue for 24 hours.
> 
> !\[Image\](https://github.com/user-attachments/assets/09e99997-9f84-42e4-b619-105ef1508ca7)
> 
> EDIT X4: e-mailed this issue link to \`hi@cursor.com\` to ensure visibility.
> 
> EDIT X5: Tweeted on X: https://x.com/saber7ooth/status/1893093369544614281 tagigng cursor\_ai's account.
> 
> \## Here's the bug report:
> 
> \`\`\`
> Version: 0.46.0
> VSCode Version: 1.96.2
> Commit: aff57e1d9a74ed627fb5bd393e347079514436a0
> Date: 2025-02-21T04:49:24.841Z
> Electron: 32.2.6
> Chromium: 128.0.6613.186
> Node.js: 20.18.1
> V8: 12.8.374.38-electron.0
> OS: Linux x64 6.8.0-1020-oem
> \`\`\`
> 
> \`\`\`
> Python path configuration:
> PYTHONHOME = '/tmp/user/1000/.mount\_cursorBLFrdY/usr/'
> PYTHONPATH = '/tmp/user/1000/.mount\_cursorBLFrdY/usr/share/pyshared/:'
> program name = '/usr/bin/python3'
> isolated = 0
> environment = 1
> user site = 1
> safe\_path = 0
> import site = 1
> is in build tree = 0
> stdlib dir = '/tmp/user/1000/.mount\_cursorBLFrdY/usr/lib/python3.12'
> sys.\_base\_executable = '/usr/bin/python3'
> sys.base\_prefix = '/tmp/user/1000/.mount\_cursorBLFrdY/usr/'
> sys.base\_exec\_prefix = '/tmp/user/1000/.mount\_cursorBLFrdY/usr/'
> sys.platlibdir = 'lib'
> sys.executable = '/usr/bin/python3'
> sys.prefix = '/tmp/user/1000/.mount\_cursorBLFrdY/usr/'
> sys.exec\_prefix = '/tmp/user/1000/.mount\_cursorBLFrdY/usr/'
> sys.path = \[
> '/tmp/user/1000/.mount\_cursorBLFrdY/usr/share/pyshared',
> '/home/saber7ooth/Documents/repos/comfyg',
> '/tmp/user/1000/.mount\_cursorBLFrdY/usr/lib/python312.zip',
> '/tmp/user/1000/.mount\_cursorBLFrdY/usr/lib/python3.12',
> '/tmp/user/1000/.mount\_cursorBLFrdY/usr/lib/python3.12/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 0x000078a6d9b58740 (most recent call first):
> \<no Python frame\>
> \`\`\`
> 
> Happens when doing anything related to \`npm\`. Running \`cursor .\` also ends me up in the AppImage's virtual directory after putting cursor into \`/opt/cursor\` and adding that to PATH with my usual \`~/.bashrc\` alias. This did not occour prior to updating to 0.46.0:
> 
> Here's that portion of \`~/.bashrc\`:
> 
> \`\`\`bash
> cursor() {
> # Run the cursor command and suppress background process output completely
> (nohup /opt/cursor/cursor.AppImage --no-sandbox "$@" \>/dev/null 2\>&1 &)
> }
> \`\`\`
> 
> I use the usual \`nohup\` trick to avoid the AppImage forking itself into the foreground/taking over the terminal process. Again, nothings changed, and this worked before the update.

export “PYTHONHOME=”

you can also add it to your launch config

```auto
{
    "configurations": [
        {
            ...
            "env": {
               ...
                "PYTHONHOME": ""
            }
        }
    ]
}

```

---

<div class="post-metadata">

**Author:** ![czue](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/czue/32/28928_2.png) [@czue](https://forum.cursor.com/u/czue)\
**Post date:** [February 24, 2025, 3:24pm UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/8 "2025-02-24T15:24:58Z")

</div>

For me the only workaround that worked was downgrading.

[This comment](https://github.com/getcursor/cursor/issues/2734#issuecomment-2677163664) has a link to the 0.45.14 appimage which fixes it

---

<div class="post-metadata">

**Author:** ![serghei](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/serghei/32/19303_2.png) [@serghei](https://forum.cursor.com/u/serghei)\
**Post date:** [February 24, 2025, 4:18pm UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/9 "2025-02-24T16:18:27Z")

</div>

In Linux, I managed to fix this by rolling back to version 0.45.14 (I had the same issues even with 0.45.15, not only 0.46). I also used the script kindly provided by @Kirai and made a few modifications to make it work in Wayland (added the `--ozone-platform=wayland` option). For details see [Installing command line launcher on Linux - #6 by Kirai](https://forum.cursor.com/t/installing-command-line-launcher-on-linux/7151/6)

For Version Download Links see [GitHub - oslook/cursor-ai-downloads: all cursor ai version download links, and some older versions offer a better user experience](https://github.com/oslook/cursor-ai-downloads?tab=readme-ov-file)

---

<div class="post-metadata">

**Author:** ![asarama](https://avatars.discourse-cdn.com/v4/letter/a/ecccb3/32.png) [@asarama](https://forum.cursor.com/u/asarama)\
**Post date:** [February 28, 2025, 10:28pm UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/10 "2025-02-28T22:28:06Z")

</div>

So any response from the cursor team to fix this in future versions or are we all going to be stuck on version 0.45.x?

---

<div class="post-metadata">

**Author:** ![rashchedrin](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/rashchedrin/32/33236_2.png) [@rashchedrin](https://forum.cursor.com/u/rashchedrin)\
**Post date:** [March 5, 2025, 5:17pm UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/11 "2025-03-05T17:17:10Z")

</div>

I downgraded to 0.45, but it got upgraded to 0.46.3 and the issue appeared again.

---

<div class="post-metadata">

**Author:** ![denis1](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@denis1](https://forum.cursor.com/u/denis1)\
**Post date:** [March 7, 2025, 11:15am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/12 "2025-03-07T11:15:21Z")

</div>

This bugs also effects all my extensions for linting, which makes the IDE unusable for me right now.  
Ruff or Pylint throw errors like

```python
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'

```

---

<div class="post-metadata">

**Author:** ![Kruz](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/kruz/32/34233_2.png) [@Kruz](https://forum.cursor.com/u/Kruz)\
**Post date:** [March 8, 2025, 8:01am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/14 "2025-03-08T08:01:14Z")

</div>

I worked on this for hours and somehow found a work around for me.  
It’s happening because Cursor is forcing its own Python environment.

**I simply added this to the bottom of my ~/.bashrc and restarted Cursor:**

```auto
export PYTHONHOME=""
export PYTHONPATH=""

```

After doing that it worked with no errors, including showing proper linting.

_ **How I figured it out:** _

When I unset the values manually in the terminal (in cursor), I could then run the file:

```auto
unset PYTHONHOME
unset PYTHONPATH
python3 main.py (or clicking the run button)

```

However, if I restarted Cursor or opened a new terminal and tried running the file again, it would show the same error:

```auto
Python path configuration:
  PYTHONHOME = '/tmp/.mount_CursorXomwZv/usr/'
  PYTHONPATH = '/tmp/.mount_CursorXomwZv/usr/share/pyshared/:'
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1

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 0x000073646c2c9740 (most recent call first):
  <no Python frame>

```

So instead of having to unset the two values manually every time I ran my .py file, I just made it permanent by forcing those values to be unset by adding it to my ~/.bashrc and wallah!

Hope this helps someone!

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/c/f/cf7a378890fa784061646e743683c914cfa2f8e0.png)

---

<div class="post-metadata">

**Author:** ![juanmah](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/juanmah/32/34246_2.png) [@juanmah](https://forum.cursor.com/u/juanmah)\
**Post date:** [March 8, 2025, 8:38am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/15 "2025-03-08T08:38:13Z")

</div>

I solved in terminal by adding in `settings.json`:

```json
    "terminal.integrated.env.linux": {
        "PYTHONHOME": ""
    }

```

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [April 7, 2025, 8:38am UTC](https://forum.cursor.com/t/cursor-0-46-0-adds-pythonhome-to-env-with-wrong-value/52714/16 "2025-04-07T08:38:30Z")

</div>

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