Questions tagged [vscode-python]

Questions about working with Python in Visual Studio Code using the Microsoft Python extension.

This VS extension makes VS Code a python IDE. Supports any operating system with most of Python interpreters. It provides IntelliSense, linting, debugging, and unit testing, environment switch using virtual and conda environments, etc.

127 questions
1
vote
0 answers

Anyone know how to fix this scrolling bug in the VSCode python test explorer?

Here's a link to a gif of the problem My problem is that I have a large batch of unit tests, many of which are out of date and need fixing. If I try and just run 1 specific unit test, the test explorer will run that test correctly, but will do…
Michael
  • 203
  • 1
  • 4
  • 10
1
vote
1 answer

Running python code in VS Code terminal hitting Invalid syntax

I save the below snippet into a file, say, stackoverflow.py and go to terminal and run (within my conda env) then everything is fine. But in VS Code, under the same conda env, it hits Invalid Syntax. The white screenshot is the result from Mac…
EyeQ Tech
  • 7,198
  • 18
  • 72
  • 126
1
vote
0 answers

Can't execute Python tasks: command 'python.*' not found

When I try to execute python commands, the commands look funny. They all start and end with a %. When I select one, I receive this error: command 'python.configureTests' not found I tried re-installing the extension as well but no luck. See the…
AskYous
  • 4,332
  • 9
  • 46
  • 82
1
vote
1 answer

Running "Active File" closing before I can see anything in VS Code

I just installed python onto my computer and I'm testing it with some simple code like print("test") and when I try to run the code through the Terminal - Run Active File it opens a command prompt window and closes it instantly. It only slowed down…
1
vote
0 answers

VS Code Python Extension: Settings for Linter

I'm using flake8 and normally, you can suppress warnings by warning type. For example, the following will suppress error groups E1 & E23: flake8 --ignore=E1,E23 path/to/files/ Any ideas on how to do that when flake8 is integrated in the…
Ioulaum
  • 11
  • 2
0
votes
0 answers

VSCode Portable disable auto-expansion of folded blocks

In VSCode Portable, is there a method/setting to disable automatic expansion of folded functions (or other types of foldable blocks, I guess) on start-up? That is, if I fold a function block, close VSCode and open the file the next day again, that…
bproxauf
  • 1,076
  • 12
  • 23
0
votes
0 answers

how to enable "Copy python" in VSCode

I was playing with vscode settings and I disabled "copy python" functionality by mistake and I don't know how to re-enable it again :-( just to be clear the functionality that I'm talking about is that for example I have this file: #…
juanp_1982
  • 917
  • 2
  • 16
  • 37
0
votes
0 answers

VS Code keeps freezing "The window is not responding" + turns main interface gray

I'm doing extra EDA on a Jupyter Notebook after I built out a model because the models eval metrics aren't great. I created a new file within the same folder that way I could work on the same venv and stay in the same directory. The model file works…
0
votes
0 answers

VSCode debuging flask app creates Error [WinError 10038] on save/reload

Since few days I have an issue with reloading when debugging flask apps. Usually, when saving changes the debugger restarts and I could work on my app. Now it still saves and reloads, but throws an error message. INFO:werkzeug: * Detected change in…
Joe Platano
  • 586
  • 1
  • 14
  • 27
0
votes
0 answers

VSCode not coloring certain Python modules

I have a Python virtual environment (venv) with several external libraries/packages installed, such as torch, gradio, and HuggingFace's transformers. I use the interpreter inside the venv to indicate VSCode of code coloring. It works well with torch…
0
votes
1 answer

For loop iteration changing when I rerun the Python file

for i in range(1,5): print(i) a = input("Enter a Number") If I don't Enter anything into the Input and Rerun the File again In VSCODE Terminal, The For loop iteration is advancing. However I was expecting it to reset back to its initial…
0
votes
0 answers

How to publicly expose package interface cleanly? Relative imports are polluting the namespace

I want to create a clean package namespace so when user types pkg.mod they only see left and right in autocomplete. However I cannot figure out how to avoid autocomplete showing thing package name. I am using VSCode. How can I correct…
0
votes
1 answer

VSCode Python Extension: Autocomplete doesn't detect the type of an hinted attribute when it's used in the same method

When an attribute is created and hinted, and then used in the same method, the autocomplete doesn't work (only shows python object stuff): But if I try to use the attribute inside another method, the autocomplete works and show all the specific…
Camilo
  • 35
  • 4
0
votes
2 answers

Vscode uses the other interpreter which is not the one that I selected

The python interpreter that I choose is python 3.7.16(tf:conda )which is set by anaconda. And its path in my computer is F:\anaconda\envs\tf\python.exe. In the user's setting.json , I changed the interpreter path to…
0
votes
0 answers

How to get list of parent methods in VSCode?

In PyCharm I can hit Ctrl/Cmd + O and it'll give me a modal with all methods I can override. What's the equivalent in VSCode?
Epic Programmer
  • 383
  • 3
  • 12
1 2 3
8 9