简体   繁体   中英

VS Code - Intellisense varies

I have to admit, I am very stumped and must be missing something obvious.

On one user profile on my macbook, VS code works like a dream. For code like

import numpy as np

np.random.

I get code help/completion. FWIW, I am using a conda environment.

When I switch my User to one that I use in class to teach, with a conda environment that matches, and for what I believe are the same extensions installed, Intellisense does not occur.

I know that this has been asked, but I have yet to see a clear resolution, and the fact that I am using the same machine, with what I believe is the same setup, is really puzzling.

Thanks in advance.

According to your description, it is recommended that you try to check the following points:

  1. Please check whether the module " numpy " has been successfully installed in the VSCode environment you are currently using. Only when this module is installed successfully, VSCode can recognize the method in the module and provide prompts.

    在此处输入图片说明

  2. Since the code prompt and completion function in VSCode is provided by the Python extension , it is recommended that you check whether it is installed and available.

In addition, you can try to use the extension " Pylance ", which provides outstanding language service functions and IntelliCode, etc.

Update :

The code prompt and completion function provided by different language services are different. Since you want to see randint , rand , random_integers as an option, you can use "python.languageServer":"Jedi", in settings.json .

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM