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.

Python Debugger is overiding PYTHONPATH

See original GitHub issue

Environment data

  • VS Code version: 1.27.1
  • Extension version (available under the Extensions sidebar): 2018.8.0
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda 5.2

Actual behavior

When I debug a python file in vscode my PYTHONPATH variable is overridden.

here is the relevant line shown on the terminal.

set “PYTHONPATH=c:\Users\username.vscode\extensions\ms-python.python-2018.8.0\pythonFiles\experimental\ptvsd”

Expected behavior

I would expect the PYTHONPATH to be appended to not overridden.

Steps to reproduce:

  1. Set the PYTHONPATH variable to something
  2. debug a script with the follow code:
import sys
print(sys.path)

You should not see the path that you set in the PYTHONPATH

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Hareiscommented, Sep 12, 2018

Yes, I try to roll back to before version, i can start debugging code

0reactions
ericsnowcurrentlycommented, Sep 18, 2018

I was able to verify that my PYTHONPATH env var shows up in sys.path in a debugged program.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Right click -> Debug breaks PYTHONPATH : PY-42951
Right click -> Debug breaks PYTHONPATH ... with the PYTHONPATH in a way that submodules of my test module accidentally override the core...
Read more >
pdb — The Python Debugger — Python 3.11.1 documentation
Note that internal pdb commands can be overridden by aliases. Such a command is then hidden until the alias is removed. Aliasing is...
Read more >
Conda and Visual Studio Code debugging - python
Override the parameter python.venvPath with the Path to folder with a list of Virtual Environments. For the case of anaconda:.
Read more >
Using Python environments in VS Code
You can override this behavior by specifying a different path in the python property of a debug configuration. See Choose a debugging environment....
Read more >
Advanced Visual Studio Code for Python Developers
Debugging Your Python Scripts in Visual Studio Code ... To override an existing binding, right-click on the existing action and click Change Keybinding....
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