VS Code 1.41.1
python3-pandas 0.23.3
Debian buster (10)
I cannot get definitions of pandas functions in VS Code. Definitions for all other python3 packages are available though. Here is a MWE:
import pandas
import quandl
df = quandl.get("WIKI/GOOGL")
df.fillna(value=-99999, inplace=True)
The definition for quandl.get() is available but not the one for df.fillna(). Definitions for functions and classes of other python3 modules are available as well. BTW pandas-doc is not available with pip and pip3 but I have it installed from the python repositories (python-pandas-doc). Any idea how this can be fixed?
2
Answers
I strongly suggest you create a virtual environment to work with vscode. Here are the steps I take to create it on Windows 10:
Install virtualenv (
pip install virtualenv
)virtualenv -p "path_to_python.exe" .venv
).venvbinactivate.ps1
or if you are using Linuxsource .venv/bin/activate
requirements.txt
file with your dependencies:[Edit]: it’s key to define proper version for you deps, otherwise you will have to dig wich version is being installed by pip.
pip install -r requirements.txt
(add--no-deps
if you just want code completion and you will not run the code locally)When the installation is don, you should be able so use all code-completion features in vscode.
I met the same problem: there is a sample:
VScode can find the definition of the figure() but failed to find the definition of add_subplot.