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
2
votes
0 answers

VS Code Python Autocomplete not parsing conditional imports (__init__.py)

I have been trying and failing to get autocomplete to properly handle conditional imports (ie: imports os and uses if/elif/else check for os dependent library import) when importing a library (I believe the engine that handles it is IntelliSense but…
Shakrii
  • 21
  • 2
2
votes
0 answers

Vscode intelliSense does not work for wx module

I installed the latest version of vscode, python and wxPython module. In vscode, the wx module do not have IntelliSense feature. When I type wx plus'.', nothing pops. While the object (e.g wx.Frame) do have IntelliSense result. Since the wx module…
neo
  • 66
  • 3
2
votes
1 answer

Can't run python code through VS Code. Can't open file ptvsd_launcher.py [Errno 22] Invalid Argument

VSCode was working perfectly a few days ago before this started happening. Attempting to run any python code through VSCode (with or without debugging) Results in this error in the terminal can't open file…
2
votes
3 answers

How to get test explorer to work for Python VS Code?

I've recently installed VSCode and it's python extension. Everything is going great but the test explorer won't populate with tests. I've run test discovery and I can even run the tests but the explorer won't populate with any information. In the…
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
2
votes
3 answers

VSCode with Python Extension April 2019 - "Python Extension Loading..."

I am unable to get Python extension working with fresh install of VS Code / Python 3.7.3 on Windows 10. VS Code status bar shows a message 'Python extension loading...' continuously. Python is installed in a non-standard path at…
Spurgeon
  • 148
  • 5
  • 12
1
vote
1 answer

Why are PyCharm and Pylance not detecting packages installed in editable mode?

Recently, code analysis tools like PyCharm and Pylance in VSCode are not picking up packages installed in editable mode (pip install -e ). This made it so I could not navigate to imported modules by Ctrl-clicking (in VSCode), and it is…
ini
  • 175
  • 9
1
vote
1 answer

VSCode Python Testing `Test result not found for...` bug

While working in a multi-project (VSCode would call it multi-root) python repository the VSCode python plugin for testing fails to run all the test when choosing to run all the tests, however running individual folders or tests passes. This is…
Rijul Gupta
  • 1,045
  • 13
  • 20
1
vote
2 answers

Kedro Pipeline contains no nodes after applying all provided filters

ValueError: Pipeline contains no nodes after applying all provided filters src/pipelines/data_processing
src/pipelines/data_science
src/pipelines/data_project
src/pipelines/pipeline2
Kedro build-docs-> dont'work pip install…
1
vote
3 answers

for-loop error : "Output exceeds the size limit." (VSCode)

I was trying to make a for loop to sum the integers from 1 to 100 in Python and wrote the code like this : for i in range(1, 101) : sum_list = [] sum_list.append(i) print(sum(sum_list)) but it didn't print the output I wanted (5050) and…
1
vote
0 answers

VSCode python debugger isn't hitting breakpoint in a Notebook callback function

I'm running a(n) .ipynb file within VSCode, trying to debug a callback function. No breakpoints within the callback function are hit, although the breakpoint I've set in the main code cell correctly pauses code execution when running the cell in…
jmk
  • 21
  • 2
1
vote
1 answer

How to use a class attribute as the type hint for a method inside the class?

class Foo: method_type: type def method(self) -> ???: # code # Example use: class FooStr(Foo): method_type = str foo_str = FooStr().method() # should be str according to vscode's intellisense class FooInt(Foo): …
TNTzx
  • 407
  • 2
  • 11
1
vote
1 answer

What is the alternative to python.pythonPath in settings.json?

In a Python tutorial I'm following, the Python path is linked to the python.pythonPath setting in the settings.json file of Visual Studio Code. However, the python.pythonPath does not exist anymore. I tried to find the python.pythonPath variable or…
1
vote
1 answer

VSCode Import Quick Fixes always Relative to ${workspaceFolder}

I'm working on a python project within a pretty large multi-language mono-repo with VSCode's python tools (pylance). The root of the workspace(/repo) is not the root module of python imports. When attempting to "Quick-Fix" an undefined variable, the…
Thomas Matecki
  • 629
  • 5
  • 20
1
vote
0 answers

devcontainer.json for VScode using existing Container

How to use existing container in VSCode? I have a file called .devcontainer.json. The path is /home/myname/Documents/ABC/.devcontainer. { "name": "Kaggle Dev CPU", "image": "gcr.io/kaggle-images/python:v100", "extensions": [ …
Ichsan
  • 768
  • 8
  • 12
1
vote
0 answers

How to search python function definitions across all installed packages in vscode

I want to search for a function name across all installed packages and also in the packages defined by python.autoComplete.extraPaths vscode setting. Vscode search panel searches only in the current workspace. Whereas in pycharm IDE ctrl + click on…
Mohamed
  • 75
  • 1
  • 11
1 2 3
8 9