5

I'm trying to find the solution for days, but I didn't get it yet. So, if you guys could help me I'd appreciate it. I've been using emacs to code in Python, I'm a very beginner using emacs, so, I decided to install the autocomplete Jedi feature. In some tutorials I've found they ask me to add this line in the ./emacs file (add-hook 'python-mode-hook 'auto-complete-mode) (add-hook 'python-mode-hook 'jedi:ac-setup)

I add those lines in the file and restart Emacs, however when I open some .py file they report me some errors. ps. I've installed Jedi through the Melpa package! ps. I'm using Ubuntu 12.04

Thanks in advance!

4

1 回答 1

3

在询问与 Emacs 相关的问题时,一个好主意是指定您使用的操作系统,因为解决方案可能是以 OSX/Linux 为中心而不是 Windows。您可能还想发布特定的错误消息。

您必须在您的 emacs 配置文件中输入这些行,在 Linux/OSX 上将位于~/.emacs. 波浪号表示您的主文件夹。您还可以将您的 emacs 配置放入~/.emacs.d/init.el.

如果您的问题没有更具体,我只能说我使用el-get包管理器来安装绝地。并在我的配置中使用以下内容来使事情正常进行。

(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:setup-keys t)                     
(setq jedi:complete-on-dot t) 

还要确保您的 PYTHONPATH 环境变量设置正确。你会export $PYTHONPATH=/path/to/python/libraries在你的~/.bashrc. 仅当您将 python 模块安装在非标准位置时才需要这样做。

例如,请参阅Emacs deferred errors以获取与您得到的类似的错误。

于 2013-11-17T21:25:59.030 回答