Environment
cd workspace/playground
python3 -m venv .
source bin/activate
pip install pandas
pip install pycorp2
Running
cd workspace/playground
source bin/activate
py playground.py
I have a Python script that uses Pandas and PyCorp2. Running it via the terminal as per above works. However, I cannot figure out what I have wrong with VS Code.
When I launch VS Code with the Python extensions installed (Python, Pylance, Python Debugger, Python Environments), they don't work. In the notification area I get Refreshing virtual environments, Refreshing Global Python interpreters, Discovering Python Interpreters, and Initializing virtual environments. These messages do not go away.
I do not see any errors in the Output window for Python, Python Debugger, or Python Environments.
What am I missing? If I try to run the file in the Run and Debug area it also doesn't produce anything and I just see a blue bar that doesn't ever stop (similar to the notifications).
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
settings.json
{
"python.useEnvironmentsExtension": true,
"python.defaultInterpreterPath": "/home/<me>/workspace/playground/bin/python3"
}
The same thing happens if I switch the interpreter to /usr/bin/python3 and remove the virtual environment that was created. It feels like to me VS Code isn't finding Python.