Visual Studio How to Add a Python Module to Intellisense

How to add custom python module to Visual Studio IntelliSense code completion tool?

Situation: I'm working on a python module that references another module that I saved in /myPython/foo.py.

If I start typing foo.someDef, I would like IntelliSense to know that I am accessing this module and suggest completing it.

+13
source share
2 answers

Visual Studio Intellisense recognizes custom Python modules after they are correctly placed in the "site-packages" folder in the "Lib" folder in the Python directory.

For example: / Python27 / Lib / site-packages / myPython

Inside the "myPython" folder, put a simple text file named "__init__.py". Otherwise, Intellisense will not recognize your package.

You may also have to click "Update Database" on the "Python Environments" tab.

Menu to Python Tools Python Environments

+9
source

Hello , this is a new plugin with intellicode support for VS 2017 (python). You can install it and check the result. https://marketplace.visualstudio.com/items?itemName=VisualStudioExptTeam.VSIntelliCode enter image description here Turn on the Intellisense Database! OFF! by setting -> tools-> options -> python-> experimental ->! ON!

Now it works with the new AI-based intellicode. enter image description here

There may be a short delay time called ai-backend-communication ( https://prod.intellicode.vsengsaas.visualstudio.com/ ). But in a short time you will get all the information about intellicode - maybe - maybe it can last one day :)). Repeat the point several times if necessary.

Best Axel Arnold Bangert - Herzogenrath 01.2019

0
source

All Articles