[PYTHON] Numpy's intellisense (input completion) is incomplete in VS Code and I was lightly addicted to the solution

problem

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 ~ 解決後

environment

Conclusion

Just add the settings to setting.json in the directory .vscode.

procedure

Find out where packages such as NumPy are located

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.

Add settings to setting.json

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)

in conclusion

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

Numpy's intellisense (input completion) is incomplete in VS Code and I was lightly addicted to the solution
The file name was bad in Python and I was addicted to import
I was addicted to confusing class variables and instance variables in Python
I was addicted to creating a Python venv environment with VS Code
Note that I was addicted to npm script not passing in the verification environment
What I was addicted to when combining class inheritance and Joint Table Inheritance in SQLAlchemy
What to do if Python IntelliSense is not displayed in VS Code on Windows
I was addicted to scraping with Selenium (+ Python) in 2020
I was addicted to trying logging.getLogger in Flask 1.1.x
When I tried to install PIL and matplotlib in a virtualenv environment, I was addicted to it.
I want to get rid of import warnings from Pyright and pylint in VS Code
If you want Python completion in VS Code, Microsoft Python Language Server is the best story
The story I was addicted to when I specified nil as a function argument in Go
I tried to summarize the code often used in Pandas
I tried to illustrate the time and time in C language
I want to map the EDINET code and securities number
I want to be able to run Python in VS Code
I want to use VS Code and Spyder without anaconda! !! !!
What I was addicted to in Collective Intelligence Chaprter 3. It's not a typo, so I think something is wrong with my code.
I wrote AWS Lambda, and I was a little addicted to the default value of Python arguments
The record I was addicted to when putting MeCab on Heroku
How to give and what the constraints option in scipy.optimize.minimize is
What I was addicted to with json.dumps in Python base64 encoding
How to judge that the cross key is input in Python3
I wrote the code to write the code of Brainf * ck in python
How to input a character string in Python and output it as it is or in the opposite direction.
I was addicted to multiprocessing + psycopg2
Sample code to get the Twitter API oauth_token and oauth_token_secret in Python 2.7
I want to format and check Python code to my liking on VS Code
I implemented the VGG16 model in Keras and tried to identify CIFAR10
I thought it was the same as python, and I was addicted to the problem that the ruby interpreter did not start.