Python Forum
Visual Studio Code Intellisense for Imported Modules Not Working - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Visual Studio Code Intellisense for Imported Modules Not Working (/thread-36900.html)



Visual Studio Code Intellisense for Imported Modules Not Working - hockinsk - Apr-10-2022

New to the forum and Python and struggling to search with the right terminology to fix this s issue or if it's possible. When I install a custom module using pip, should intellisense work for shorthand use of that module in Visual Studio Code IDE when using an import Alias as below? Intelisense otherwise works fine and I've installed the Python extension which includes Pylance and works fine for native modules. Native and installed modules are all in the same global folder where pip installs by default, PATH set for Windows. Python --version 3.10.4

No intellisense
import mediapipe as mp
mp_face_mesh = mp.solutions.face_mesh

If I explicitly go through the entire module Intellisense works
import mediapipe as mp
mp_face_mesh = mp.solutions.mediapipe.python.solutions.face_mesh


Here's the 'show' from pip of this particular module

C:\Users\skhoc>pip show mediapipe
Name: mediapipe
Version: 0.8.9.1
Summary: MediaPipe is the simplest way for researchers and developers to build world-class ML solutions and applications for mobile, edge, cloud and the web.
Home-page: https://github.com/google/mediapipe
Author: The MediaPipe Authors
Author-email: [email protected]
License: Apache 2.0
Location: c:\users\skhoc\appdata\local\packages\pythonsoftwarefoundation.python.3.10_qbz5n2kfra8p0\localcache\local-packages\python310\site-packages
Requires: absl-py, attrs, matplotlib, numpy, opencv-contrib-python, protobuf
Required-by:



RE: Visual Studio Code Intellisense for Imported Modules Not Working - deanhystad - Apr-23-2022

This may be the same problem I had with PySide2. PySide2 is nearly all C with very little Python code. So little Python code that VSCode has nothing to work with. Installing Kite didn't even improve things, and Kite is continuously snooping around for every bit of information.

mp.solutions.mediapipe.python.solutions.face_mesh is probably a bunch of stubs provided to make the library work better with Python.