Emacs&蟒蛇。链接问题 [英] Emacs & Anaconda. Linking problems
问题描述
- 为了运行 Anaconda ,我需要 unset
LD_LIBRARY_PATH
- 为了运行Emacs(以及其他程序),我需要设置
LD_LIBRARY_PATH
如果我尝试运行 Emacs
同时取消设置 LD_LIBRARY_PATH
我遇到了连接问题,例如
符号查找错误:/usr/lib64/libpangocairo-1.0.so.0:未定义符号:
cairo_ft_font_options_substitute
如果我尝试加载 gedit $,我遇到同样的问题c $ c>或其他程序。鉴于此,我目前无法在同一环境中使用Anaconda和Emacs。
这样可以防止我使用Emacs软件包,例如 emacs-jedi (一个用于编辑和调试Python代码的好包),需要一个运行正常的Python环境(特别是 emacs-jedi 需要 epc )。
有关如何规避这个问题的任何想法? (注:我没有root权限)
更新:
- 我已经尝试将
$ ANACONDA / lib
添加到我当前的LD_LIBRARY_PATH
中,但这个也结果在符号中查找我上面描述的错误。 -
我还尝试更新
$ PATH
和在我的
.emacs
文件中,将其放在顶部,没有运气:(setenvPATH(concat/home/josh/installs/conda/1.7.0/bin/:(getenvPATH)))
(setenvLD_LIBRARY_PATH(concat/home/josh/installs/conda/1.7.0/lib/:(getenvLD_LIBRARY_PATH)))
-
这是一个线程,更详细地解释了我得到的错误:使用LD_LIBRARY_PATH将Anaconda连接问题
有几种方法可以解决它,但可能这是最简单的(未测试的)。
(defadvice jedi:start-server(around my-jedi:start-server-ld-library-path-hack
activate)
启动Jedi服务器时取消设置LD_LIBRARY_PATH。
(let((process-environment(mapcar#'identity process-environment)))
(setenvLD_LIBRARY_PATH); unset $ LD_LIBRARY_PATH
ad-do-it))
如果这样工作,也许是更好的主意,让它在Jedi.el.我可以想象,有时将项目更改为项目的 LD_LIBRARY_PATH
是有用的。
其他方式之一修复它在Emacs之外运行Jedi EPC服务器(例如,在终端中)。这样,您可以轻松地控制任何环境变量。参见:
http:// tkf .github.io / emacs-jedi / latest /#jedi:toggle-debug-server
I have a problem where:
- In order to run Anaconda, I need to unset
LD_LIBRARY_PATH
- In order to run Emacs (as well as other programs), I need to set
LD_LIBRARY_PATH
If I try to run Emacs
while unsetting LD_LIBRARY_PATH
I run into linking problems, e.g.
symbol lookup error: /usr/lib64/libpangocairo-1.0.so.0: undefined symbol:
cairo_ft_font_options_substitute
And I run into the same problem if I try to load gedit
or other programs. Given this, I am currently unable to use Anaconda and Emacs in the same environment.
This prevents me from using Emacs packages such as emacs-jedi (a great package for editing and debugging Python code) which require a functioning Python environment (specifically emacs-jedi requires epc).
Any ideas on how to circumvent this problem? (Note: I don't have root access)
Update:
- I have tried prepending
$ANACONDA/lib
to my currentLD_LIBRARY_PATH
, but this also results in the symbol look up errors that I described above. I have also tried updating
$PATH
and$LD_LIBRARY_PATH
on my.emacs
file, by putting this at the top with no luck:(setenv "PATH" (concat "/home/josh/installs/conda/1.7.0/bin/:" (getenv "PATH"))) (setenv "LD_LIBRARY_PATH" (concat "/home/josh/installs/conda/1.7.0/lib/:" (getenv "LD_LIBRARY_PATH")))
Here is the thread that explains in more detail the errors that I get : Linking problems with Anaconda when using LD_LIBRARY_PATH
There are several ways to fix it, but probably this is the most easiest (untested).
(defadvice jedi:start-server (around my-jedi:start-server-ld-library-path-hack
activate)
"Unset LD_LIBRARY_PATH when starting Jedi server."
(let ((process-environment (mapcar #'identity process-environment)))
(setenv "LD_LIBRARY_PATH") ; unset $LD_LIBRARY_PATH
ad-do-it))
If this works, maybe it is better idea to have it in Jedi.el. I can imagine that sometimes it is useful to change LD_LIBRARY_PATH
for project to project.
One of the other ways to fix it to run Jedi EPC server outside of Emacs (e.g., in terminal). This way, you can easily control any environment variables. For starter, see: http://tkf.github.io/emacs-jedi/latest/#jedi:toggle-debug-server
这篇关于Emacs&蟒蛇。链接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!