V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
hz2019
V2EX  ›  Python

vscode+ Python pip 包怎样自动补全?

  •  
  •   hz2019 · 2021-02-24 16:25:50 +08:00 · 1920 次点击
    这是一个创建于 1128 天前的主题,其中的信息可能已经有所发展或是发生改变。

    插件 python pylance

    自带的标准模块都可以自动补全,但是 pip 安装的不能自动补全,比如 pywin32 。

    import win32gui可以自动补全,但是w.之后GetWindowText()不会出来。

    import win32gui as w
    title = w.GetWindowText(w.GetForegroundWindow())
    

    配置里也加上了。

    "python.autoComplete.extraPaths": [
        "C:/Users/hh/AppData/Local/Programs/Python/Python39/Lib/site-packages",
        "C:/Users/hh/AppData/Local/Programs/Python/Python39/Scripts"
    ],
    "python.analysis.extraPaths": [
        "C:/Users/hh/AppData/Local/Programs/Python/Python39/Lib/site-packages",
        "C:/Users/hh/AppData/Local/Programs/Python/Python39/Scripts"
    ],
    "python.linting.pylintEnabled": true,
    "python.linting.enabled": true
    

    求助一下,该如何解决

    5 条回复    2021-02-27 21:04:05 +08:00
    aeron
        1
    aeron  
       2021-02-24 17:13:06 +08:00
    装个 kite 试试
    cyersvet
        2
    cyersvet  
       2021-02-24 18:11:38 +08:00 via Android
    pywin32 库无法自动补全,只有它里面自带的那个简陋的 ide 可以
    hz2019
        3
    hz2019  
    OP
       2021-02-24 19:44:03 +08:00
    @aeron 这个试了,函数首次使用还是不行的
    hz2019
        4
    hz2019  
    OP
       2021-02-24 19:44:23 +08:00
    @cyersvet 是这个原因,换成别的就可以了
    zgxzgx
        5
    zgxzgx  
       2021-02-27 21:04:05 +08:00
    装个 pylance
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1521 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:18 · PVG 01:18 · LAX 10:18 · JFK 13:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.