V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · Feb 24, 2021 · 2833 views
    This topic created in 1889 days ago, the information mentioned may be changed or developed.

    插件 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 replies    2021-02-27 21:04:05 +08:00
    aeron
        1
    aeron  
       Feb 24, 2021
    装个 kite 试试
    cyersvet
        2
    cyersvet  
       Feb 24, 2021 via Android
    pywin32 库无法自动补全,只有它里面自带的那个简陋的 ide 可以
    hz2019
        3
    hz2019  
    OP
       Feb 24, 2021
    @aeron 这个试了,函数首次使用还是不行的
    hz2019
        4
    hz2019  
    OP
       Feb 24, 2021
    @cyersvet 是这个原因,换成别的就可以了
    zgxzgx
        5
    zgxzgx  
       Feb 27, 2021
    装个 pylance
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1405 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 17:03 · PVG 01:03 · LAX 10:03 · JFK 13:03
    ♥ Do have faith in what you're doing.