Visual Studio如何将Python模块添加到Intellisense [英] Visual Studio How to add Python module to Intellisense
问题描述
如何将自定义python模块添加到Visual Studio IntelliSense代码完成工具中?
情况:我正在研究一个python模块,该模块引用了我保存在/myPython/foo.py中的另一个模块.
如果我开始键入foo.someDef,我希望IntelliSense能够识别出我正在访问该模块并建议代码完成.
在将自定义Python模块正确放置在Python目录的"Lib"文件夹下的"site-packages"文件夹中之后,Visual Studio的Intellisense会识别它们./p>
例如: /Python27/Lib/site-packages/myPython
在文件夹"myPython"内,放置一个名为"__init__.py"的纯文本文件.否则,Intellisense将无法识别您的包裹.
您可能还需要单击"Python环境"标签下的刷新数据库".
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.
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.
这篇关于Visual Studio如何将Python模块添加到Intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!