将 virtualenv 与 sublime text 2 一起使用 [英] Using virtualenv with sublime text 2

查看:29
本文介绍了将 virtualenv 与 sublime text 2 一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 sublime text 2 和 virtualenv 进行 python 开发!

I am using sublime text 2 for python development along with virtualenv!

标准的 sublime text 2 构建系统使用标准的 python 安装,而不是安装我的包的 virtualenv.

The standard sublime text 2 build system uses the standard python install rather than my virtualenv where my packages are installed.

如何使用我的 virtualenv 构建 sublime text 2?

How can I get sublime text 2 to build using my virtualenv?

我目前使用终端来激活我的环境并运行我的脚本.

I currently use the terminal to activate my environment and run my scripts.

更新:从来没有让它工作,但看到我正在使用烧瓶并且在你进行更改时它会构建,这不是一个大问题

UPDATE: Never got it working, but seeing as i am using flask and it builds when you make a change, it's not a big issue

推荐答案

注意有关此解决方案不正确的评论.

您必须编辑您的 sublime-project 文件并添加以下内容:

You have to edit your sublime-project file and add the following:

"build_systems":
[
    {
    "name": "Run Tests",
    "cmd": ["source", "/path/to/your/virtualenv/bin/activate"],
    "working_dir": "/path/to/to/you/django_project",
    "cmd": ["python", "manage.py", "test"]
    }
]

这篇关于将 virtualenv 与 sublime text 2 一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆