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

原来让 vscode 支持 virtualenv 这么简单

  •  
  •   liuyzh · 2017-02-18 10:32:57 +08:00 · 6468 次点击
    这是一个创建于 2629 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前不知道,还傻乎乎得修改 launch.json 配置文件

    今天才发现原来在命令行激活虚拟环境后,直接用 code 打开项目文件夹就行了。。。

    XXX>venv\scripts\activate
    (venv) XXX>code project_name/
    

    Win 系统

    neosfung
        1
    neosfung  
       2017-02-18 11:30:45 +08:00   ❤️ 1
    python 的话,如果要语法提示补全,还是要把 site-packages 加入到 settings.json 中
    ivechan
        2
    ivechan  
       2017-02-18 19:05:53 +08:00
    为什么我感觉还不如修改 launch.json 呢. 你这样岂不是每次打开都要输入一次命令.
    liuyzh
        3
    liuyzh  
    OP
       2017-02-18 23:10:04 +08:00
    @ivechan 可以写一个批处理
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2231 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 11:19 · PVG 19:19 · LAX 04:19 · JFK 07:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.