Python Forum
Visual Studio Code Intellisense for Imported Modules Not Working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Visual Studio Code Intellisense for Imported Modules Not Working
#1
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:
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  code isnt working. nezercat33 1 588 Mar-14-2025, 03:45 AM
Last Post: deanhystad
  Simple code not working properly tmv 2 476 Feb-28-2025, 09:27 PM
Last Post: deanhystad
  I'm new to Python - can someone help with this code as it is not working? lminc123 1 487 Feb-13-2025, 06:13 PM
Last Post: lminc123
  Visual Studio Code help aaronrousch 4 3,774 Jan-25-2025, 05:55 AM
Last Post: ndc85430
  I cannot create a virtual environment on visual studio code using python Willem_Aucamp316 2 2,879 Nov-27-2024, 02:20 PM
Last Post: menator01
  my code is not working erTurko 1 630 Nov-11-2024, 08:43 AM
Last Post: buran
  Code Completion in Visual Studio for External Libraries mjakov 0 567 Aug-25-2024, 02:48 PM
Last Post: mjakov
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 4,099 Nov-15-2023, 06:56 PM
Last Post: jst
  How to set PYTHONPATH in Visual Studio Code? aupres 5 12,307 Aug-15-2023, 03:51 PM
Last Post: snippsat
  New to Python - Not sure why this code isn't working - Any help appreciated TheGreatNinx 4 2,283 Jul-22-2023, 10:21 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020