question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Python File in Terminal does not respect "python.pythonPath"

See original GitHub issue

Environment data

VS Code version: 1.19.2 Python Extension version: 0.9.1 Python Version: 3.5 OS and version: Ubuntu 16.04 x64

Actual behavior

File is run with python

Expected behavior

File should be run with /usr/bin/python3

Steps to reproduce:

Set

{
    "python.pythonPath": "/usr/bin/python3"
}

and run a file.

Logs

Output from Python output panel

python <file>

Output from Console window (Help->Developer Tools menu)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
DonJayamannecommented, Jan 17, 2018

I’m working on a workspace with multiple folders. I tried “Open folder…”

Bingo, I believe that’s where the problem lies. This will be fixed in #592

0reactions
conradoplgcommented, Jan 17, 2018

Please could you try running the above command from the command palette?

I got the same result (runs with “python”).

I’m working on a workspace with multiple folders. I tried “Open folder…” with only the specific folder I’m working with right now, and then the above works. If I reopen the workspace, it stops working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode - Run Python File in Terminal and pythonpath
util - and I use 'Run Python File in Terminal' to execute the script it fails with Module not found (proj.util) - because...
Read more >
File Path and CWD - Python 3 Notes
So far we have been using the absolute path, which begins from the topmost directory. But if your file reference does not start...
Read more >
How to set python path - Net-Informations.Com
Open a command prompt window (press Windows+R, type in cmd, and hit enter). Just type "python" on the command line and see if...
Read more >
Understanding the Python Path Environment Variable in Python
To set the python environment variable PYTHONPATH on Mac, follow the given steps: Step 1: Open the Terminal. ... Step 4: Save this...
Read more >
How to Fix - bash: python: command not found Error
Make sure the python installed path is added in the PATH variable. You can see in the above output '/usr/bin' and '/bin' paths...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found