jediepcserver.py的倍数virtualenvs的倍数 [英] multiples jediepcserver.py for multiples virtualenvs

查看:93
本文介绍了jediepcserver.py的倍数virtualenvs的倍数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为不同项目的多个virtualenvs运行jediepcserver.py。我的想法是在我正在Emacs上进行的每个项目中都具有适当的自动补全功能。

I'm trying to run multiples jediepcserver.py for multiples virtualenvs for different projects. My idea is to have the proper autocompletion in each of the projects that I'm working on Emacs.

例如,我目前正在研究两个项目,一个使用Django 1.5,另一个使用Django 1.7,因此每个项目的自动完成功能都应有所不同。

For example, I'm working on two projects at the moment, one using Django 1.5 and another one using Django 1.7, so autocompletion should be different for each of the projects.

这是我的配置文件:

(setq python-environment-directory "~/.virtualenvs")


(autoload 'jedi:setup "jedi" nil t)
(add-hook 'python-mode-hook 'jedi:setup)

(setq jedi:environment-root "jedi")  ; name of the virtualenv
(setq jedi:server-command '("/home/humitos/.emacs.d/vendor/emacs-jedi/jediepcserver.py"))
(setq jedi:server-args 
      '("--virtual-env" "~/.virtualenvs/jedi"
    "--log" "/tmp/jediepcserver.log"
    "--log-level" "DEBUG"))

(setq jedi:complete-on-dot t)

(setq jedi:get-in-function-call-delay 500)

我尝试在其中使用 .dir-locals.el

(setq jedi:server-args 
      '("--virtual-env" "~/.virtualenvs/my-venv-project"
    "--log" "/tmp/jediepcserver.log"
        "--log-level" "DEBUG"))

我认为这应该可行,但我敢肯定我在配置中遗漏了一些东西。那是什么?

I think this should be possible but I'm sure that I'm missing something in the configuration. What is that?

提前感谢。

推荐答案

文档


如果要使用特定版本的Python,请正确设置jedi:environment-virtualenv变量,然后重新安装jediepcserver.py。

If you want to use a specific version of Python, setup jedi:environment-virtualenv variable appropriately and reinstall jediepcserver.py.

它还说,如果设置了 jedi:environment-virtualenv,则必须配置 jedi:environment-root code>所以...

It also says you must configure jedi:environment-root if you set jedi:environment-virtualenvso...

我的.dir-locals.el看起来像这样

my .dir-locals.el looks like this

((python-mode . ((python-shell-virtualenv-root . "/home/ale/.virtualenvs/env/")
      (jedi:environment-root . "/home/ale/.virtualenvs/env/")
      (jedi:environment-virtualenv . ("virtualenv" "--python" "/usr/bin/python3.4")) 
      )))

然后我重新安装了jediserver,看来可以正常工作!

And the I reinstall the jediserver, it seems to work!

请原谅我e缺少()())()()((((

这篇关于jediepcserver.py的倍数virtualenvs的倍数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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