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
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 1,055 Nov-15-2023, 06:56 PM
Last Post: jst
  How to set PYTHONPATH in Visual Studio Code? aupres 5 4,265 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 974 Jul-22-2023, 10:21 PM
Last Post: Pedroski55
  code not working when executed from flask app ThomasDC 1 905 Jul-18-2023, 07:16 AM
Last Post: ThomasDC
  how do I open two instances of visual studio code with the same folder? SuchUmami 3 900 Jun-26-2023, 09:40 AM
Last Post: snippsat
  Visual Studio Code NewPi 3 1,068 May-16-2023, 11:13 PM
Last Post: snippsat
  I am new to python and Could someone please explain how this below code is working? kartheekdas 2 1,026 Dec-19-2022, 05:24 PM
Last Post: kartheekdas
  Visual Studio Code venv ibm_db error mesi1000 7 2,838 Nov-13-2022, 12:36 AM
Last Post: snippsat
Exclamation My code is not working as I expected and I don't know why! Marinho 4 1,093 Oct-13-2022, 08:09 PM
Last Post: deanhystad
  debugging help on Visual Studio Code mg24 12 2,029 Oct-02-2022, 12:18 AM
Last Post: mg24

Forum Jump:

User Panel Messages

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