Visual Studio How to add Python module to Intellisense

前端 未结 2 893
别跟我提以往
别跟我提以往 2020-12-17 09:52

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

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 10:29

    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.

提交回复
热议问题