Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio How to add Python module to Intellisense

Tags:

How do I add a custom python module to the Visual Studio IntelliSense code completion tool?

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

If I start to type foo.someDef I would like IntelliSense to recognize I am accessing that module and suggest a code completion.

like image 862
CompSci-PVT Avatar asked Jun 02 '15 19:06

CompSci-PVT


1 Answers

Visual Studio's Intellisense will recognize custom Python modules after they have been properly placed in the "site-packages" folder under the "Lib" folder in Python's directory.

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

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

You may also have to click the "Refresh DB" under the Python Environments tab.

Menu to Python ToolsPython Environments

like image 52
CompSci-PVT Avatar answered Oct 10 '22 16:10

CompSci-PVT