I created an environment for deep learning using a Docker container on a Mac, Input completion of NumPy (hereinafter, IntelliSense) is incomplete, which is a little inconvenient.
~ Before resolution ~
~ After resolution ~
ms-python.python
has been introduced as an extension of VS Code
(If you put this in, python's IntelliSense works fine)Just add the settings to setting.json
in the directory .vscode
.
import numpy as np
print(np.__file__)
#Output result
# /usr/local/lib/python3.6/dist-packages/numpy/__init__.py
Since it was the above directory in my environment, check this path and move on to the next step.
setting.json
{
"python.autoComplete.extraPaths": [
"/usr/local/lib/python3.6/dist-packages"
],
}
This time I'm focusing on NumPy, but the same can be said for other libraries. If you look closely, it is explained properly in the VS Code formula.
Enable IntelliSense in custom package locations (https://code.visualstudio.com/docs/python/editing#_enable-intellisense-for-custom-package-locations)
If you know it, there's nothing wrong with it, but if you rely on extensions and don't mess with setting.json
directly, it's worth taking this opportunity to remember a little.
Recommended Posts