Emacs:Pymacs 未使用 Carbon Emacs 加载 Ropemacs
我正在尝试将 Pymacs 与 rod/ropemacs 一起使用进行 Flymake 语法检查,如下所述: http://www.enigmacurry.com/2009/01/ 21/autocompleteel-python-code-completion-in-emacs/
当我“正常”启动Carbon Emacs时,它会抛出错误:
错误:Pymacs加载ropemacs...失败
我在OSX 10.5上使用Carbon Emacs工作但在 10.6 中失败了。但是,当加载“终端”emacs、Aquamacs 或使用“/Applications/Emacs.app/Contents/MacOS/Emacs”从命令行打开 Carbon Emacs 时,它会起作用。我假设这是某种路径错误,但我一生都无法弄清楚。
我的设置是 OSX 10.6.2,我使用的是 macports python 2.6.4。
谢谢!
I'm attempting to use Pymacs with rope/ropemacs for flymake syntax checking as described here:
http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/
When I start Carbon Emacs "normally" it throws the error:
error: Pymacs loading ropemacs...failed
I had this working on OSX 10.5 with Carbon Emacs but it fails in 10.6. However, it works when loading "terminal" emacs, Aquamacs, or if I open Carbon Emacs from the command line using "/Applications/Emacs.app/Contents/MacOS/Emacs". I'm assuming this is some kind of path error, but I can't figure it out for the life of me.
My setup is OSX 10.6.2 and I'm using macports python 2.6.4.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很可能是路径问题。当您从终端启动 emacs 时,您的
PATH
环境变量可能包含 MacPorts bin 目录/opt/local/bin
因为您可能修改了您的 shell 配置文件之一,可能.bash_profile
,将该目录包含在PATH
上。但是,当您直接启动应用程序(通过双击它)时,不会涉及 shell,因此默认情况下,
/opt/local/bin
不会包含在进程的PATH< 中/代码> 变量。根据 Pymacs 等调用 python 的方式,它很可能最终会使用 Apple 提供的 python2.6(
python
或/usr/bin/env python
)。如果您能弄清楚它在哪里调用 python,您可以将其更改为绝对路径,例如/opt/local/bin/python2.6
。如果您不知道如何做到这一点,您可以通过修改
Carbon Emacs.app
包内的 plist 文件以包含LSEnvironment< 来解决该问题/code> 键与
PATH
的正确值。或者,您可以在~/.MacOSX/environment.plist
中为PATH
创建用户范围的环境定义。 此处介绍了这两个选项。否则,您可以尝试使用 Apple 提供的 Python 2.6.1 安装 Pymacs。
顺便说一句,您引用的链接中的安装说明使用
easy_install
。如果您需要将软件包安装到 MacPorts python 中,请确保为其安装并使用easy_install
实例,而不是在/usr/bin
中使用 Apple 提供的实例:Chances are it is a path problem. When you start an emacs from the terminal, your
PATH
environment variable presumably includes the MacPorts bin directory/opt/local/bin
because presumably you modified one of your shell profiles, probably.bash_profile
, to include that directory onPATH
.But when you launch an application directly (by double-clicking it) the shell is not involved so, by default,
/opt/local/bin
doesn't get included in the process'sPATH
variable. Depending on how Pymacs, et al, invoke python, it most likely ends up with the Apple-supplied python2.6 (python
or/usr/bin/env python
). If you can figure out where it's calling python, you could change that to an absolute path, like/opt/local/bin/python2.6
.If you can't figure out how to do that, you may be able to work around the problem by either modifying the plist file inside of the
Carbon Emacs.app
bundle to include aLSEnvironment
key with the proper value forPATH
. Or you can create a user-wide environment definition forPATH
in~/.MacOSX/environment.plist
. Both options are described here.Otherwise you could try installing Pymacs with the Apple-supplied Python 2.6.1.
By the way, the installation instructions in the link you cite use
easy_install
. If you need to install packages into the MacPorts python, make sure you install and use aneasy_install
instance for it and not use the Apple-supplied one in/usr/bin
: