OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

VS Code can't find Python interpreter in WSL after latest update

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

Guest
Following the latest VS Code update I have had some problems with finding my Python interpreter. VS Code seems to be looking in my C drive for my Python install, instead of inside of WSL (Ubuntu).

Screenshot of VS Code

I tried adding the following to my user's settings.json but it did not work.

Code:
    "terminal.integrated.defaultProfile.windows": "WSL",
    "python.defaultInterpreterPath": "/usr/bin/python3.12",
    "terminal.integrated.profiles.windows": {
      "WSL": {
        "path": "C:\\WINDOWS\\System32\\wsl.exe",
        "args": []
      }
    },
    "python.venvPath": "/home/yourusername/.virtualenvs",  // Optional: if you use virtual environments
    "python.terminal.activateEnvironment": true

Any ideas?
<p>Following the latest VS Code update I have had some problems with finding my Python interpreter. VS Code seems to be looking in my C drive for my Python install, instead of inside of WSL (Ubuntu).</p>
<p><a href="https://i.sstatic.net/AJHeNTs8.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/AJHeNTs8.png" alt="Screenshot of VS Code" /></a></p>
<p>I tried adding the following to my user's <code>settings.json</code> but it did not work.</p>
<pre><code> "terminal.integrated.defaultProfile.windows": "WSL",
"python.defaultInterpreterPath": "/usr/bin/python3.12",
"terminal.integrated.profiles.windows": {
"WSL": {
"path": "C:\\WINDOWS\\System32\\wsl.exe",
"args": []
}
},
"python.venvPath": "/home/yourusername/.virtualenvs", // Optional: if you use virtual environments
"python.terminal.activateEnvironment": true
</code></pre>
<p>Any ideas?</p>
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top