What to do if Python IntelliSense is not displayed in VS Code on Windows

I think IntelliSens (Autocomplete) is the best editor these days. Not only does it save you the trouble of typing, but it also gives you the form of arguments, and it also has a little documentation, so it's very effective.

But I'm developing Python using VS Code and it's huge like opencv-python, numpy, ``` scipy```, pandas IntelliSense did not appear in the library, so I made a note of how to check and fix it. However, I didn't have much information, so I don't know if this will solve everyone ()

image.png

environment

** I'm installing Python directly, not via Anaconda. ** **

settings.json

pip install [package name]

Just add the folder where the package will be installed to `'' python.autoComplete.extraPaths" in VSCode `settings.json```.

For example, if you installed Python 3.8 series with the default settings of the installer, it will be in the following folder (probably). If your Python version is 3.7, just replace `Python38``` with `Python37```.

-- C: \ Users \ <user name> \ AppData \ Roaming \ Python \ Python38 \ site-packages -- C: \ Users \ <user name> \ AppData \ Local \ Programs \ Python \ Python38 \ Lib \ site-packages

Just add this. However, if you are developing in only one environment and you do not share `settings.json``` with other environments, you can write it as it is, for example [Settings Sync](https: / When sharing using /marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) etc., <username> `` is not always the same, so it is environment-independent. To do.

settings.in json[It ’s like an environment variable](https://code.visualstudio.com/docs/editor/variables-reference)Cannotbeused,sosettings.json(Itisinthefollowinglocation)I specified the above directory with a relative path from.



 --``` C: \ Users \ <user name> \ AppData \ Roaming \ Code \ User \ settings.json```

 It will be as follows. It's roundabout, so please tell me if there is another good way.


#### **`settings.json`**
```json

...
"python.autoComplete.extraPaths":[
    "../../Python/Python38/site-packages",
    "../../../Local/Programs/Python/Python38/Lib/site-packages"	
],
...

After that, if you restart VS Code, you can use IntelliSense. By the way, I think that unresolved import'~~~' Python (unresolved-import) `` `in place of import``` is also gone.

image.png

Remarks

Change `" python.jediEnabled "``` to `false```

It may depend on the person, but I think that `" python.jediEnabled "``` of settings.json``` is ``` True```, so I call this `` False` You may have to set it to ``.

settings.json


...
"python.jediEnabled": false,
...

Can I use an absolute pass?

If you install Python in any environment such as C: \ Python or a place that does not depend on the user name, you do not have to write it with a relative path.

\In my environment installed on Python, I could write the following form.




#### **`settings.json`**
```json

...
"python.autoComplete.extraPaths":[
    "C:\\Python\\Python38\\Lib\\site-packages"
],
...

Recommended Posts

What to do if Python IntelliSense is not displayed in VS Code on Windows
What to do if the progress bar is not displayed in tqdm of python
What to do when Japanese is not displayed on matplotlib
What to do if Python doesn't work on Git for Windows
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
What to do if the image is not displayed using matplotlib etc. in the Docker container
What to do if there is a decimal in python json .dumps
[Python] Lint pylint is not installed is displayed [VS Code]
What to do if pyenv is not enabled (zsh)
What to do if you get "Python not configured." Using PyDev in Eclipse
What to do if abort is displayed when inputting camera video in OpenCV
What to do if Japanese language support is not completely installed on Ubuntu 16.04
What to do if ʻarguments [0] .scrollIntoView ();` fails in python selenium
What to do if you are addicted to Windows character code
What to do if Sort imports get stuck in VS Code's Python Extension (around 2020/09)
What to do if Python does not switch from the System version in pyenv
What to do if Jupyter Notebook on WSL does not start automatically in your browser
Create a Python environment for professionals in VS Code on Windows
What to do if you get a minus zero in Python
What to do if python says "fatal error:'stdio.h' file not found"
What to do if "Unnamed: 0" is added in to_csv-> read_csv in pandas
What to do if the inode is exhausted on EC2 Linux
What to do when the value type is ambiguous in Python?
NameError: global name'dot_parser' is not defined and what to do when it comes up in python
What to do if you can't use scikit grid search in Python
Steps to create a Python virtual environment with VS Code on Windows
What to do if No Python documentation found for ... appears in pydoc
What to do when a warning message is displayed in pip list
What to do if pipreqs results in UnicodeDecodeError
What to do to get google spreadsheet in python
[Mac OS] What to do when Python is not installed as a framework. Is displayed when import matplotlib is performed.
How to write what to do when an application is first displayed in Qt for Python with Designer
What to do if PyInstaller3.5 gives an error in Python3.8 (TypeError: an integer is required (got type bytes))
Even if the development language is changed to python3 in Cloud9, version 2 is displayed in python --version
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
What to do if CERTIFICATE_VERIFY_FAILED occurs when nltk.download () is done on macOS pyhon
What to do if a Unicode Encode Error occurs in Sublime Text Python
What to do if NotADirectoryError: [Errno 20] Not a directory:'xdg-settings' appears in jupyter notebook
What to do if (base) is displayed at the beginning of the Mac terminal
What to do if an error occurs when loading a python project created with poetry into VS Code
What to do if pip install fails in Xcode 5.1
What to do if SciPy installation fails on CentOS
What to do if a UnicodeDecodeError occurs in pip
What to do if sys / cdefs.h does not exist
What to do if you get the error RuntimeError: Python is not installed as a framework when trying to use matplitlib and pylab in Python 3.3
[Python] Type Error:'WebElement' object is not iterable What to do when an error occurs
What to do if "export" keeps appearing on terminal when trying to put Python on macOS
What to do when python3 type venv does not work well on Raspberry Pi
What to do if you get `No kernel for language python found` in Hydrogen
What to do when only the window is displayed and nothing is displayed in pygame Note
What to do if you get an error when importing matplotlib in Python (Mac)
What to do when Python starts up in Anaconda does not come out unexpectedly
What to do if you can't hit the arrow keys in the Python interactive console
What to do if you run python in IntelliJ and end with an error
Python with VS Code (Windows 10)
Test.py is not reflected on the web server in Python3.
What to do if pip gives a DistributionError in Homebrew
What to do if you get "coverage unknown" in Coveralls
What to do when "SSL: CERTIFICATE_VERIFY_FAILED _ssl.c: 1056" appears in Python
What to do if `pip install matplotlib` fails on Mac
What to do if you can't log in as root