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
SeanZhaoOrZXY
V2EX  ›  Python

求助: VScode 写 Python 无法使用 autocomplete/intellisence

  •  
  •   SeanZhaoOrZXY · 2018-03-16 10:28:36 +08:00 · 9245 次点击
    这是一个创建于 2233 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我已经下载了官方 python 插件,并在 setting.json 中正确设置了 pythonPath 路径。 目前问题是,只有 if,while 这一类能给出补全提示,print,import 这些都不行。(如输入 pri,不会给出任何东西) 但程序可以正常运行,输完关键字也会高亮显示。 VScode 版本 1.21 ,python3.6.4

    9 条回复    2018-03-18 08:42:23 +08:00
    SeanZhaoOrZXY
        2
    SeanZhaoOrZXY  
    OP
       2018-03-16 11:18:40 +08:00
    @lmusicwq 以前已经这样配置过了。。刚又执行了一下,在第三步时报错:"command 'python.setInterpreter' not found",而且状态栏没有让选择 python 环境的选项。。
    lmusicwq
        3
    lmusicwq  
       2018-03-16 11:58:58 +08:00
    @SeanZhaoOrZXY #2 你谷歌下这个错误,挺多答案的。
    建议卸载扩展重装,或者禁用其他扩展看是否还有错误。
    male110
        4
    male110  
       2018-03-16 13:24:26 +08:00
    感觉 wing 的提示功能是最强的.
    当然只说提示功能.
    SeanZhaoOrZXY
        5
    SeanZhaoOrZXY  
    OP
       2018-03-16 23:25:21 +08:00
    @lmusicwq 很感谢回复。但是重装拓展未能解决问题,禁用后 Command Palette 中连 python 相关选项都没了。。我在找找原因吧,多谢了。
    XYxe
        6
    XYxe  
       2018-03-17 15:32:10 +08:00
    我前两天也遇到过,把~/.vscode 文件夹删掉就好了。
    可以先用 settings sync 同步配置。
    SeanZhaoOrZXY
        7
    SeanZhaoOrZXY  
    OP
       2018-03-18 07:58:10 +08:00
    @XYxe 请问是删除项目根目录中的.vscode 文件夹吗?我试了下,没有生效。。
    XYxe
        8
    XYxe  
       2018-03-18 08:16:59 +08:00 via Android   ❤️ 1
    @SeanZhaoOrZXY 是用户目录下的.vscode 文件夹
    SeanZhaoOrZXY
        9
    SeanZhaoOrZXY  
    OP
       2018-03-18 08:42:23 +08:00
    @XYxe 删除后再重装插件,问题确实解决!请问是何原理呢?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5452 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 07:41 · PVG 15:41 · LAX 00:41 · JFK 03:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.