Emacs & Anaconda. Linking problems

孤者浪人 提交于 2019-12-04 11:42:27

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

Probably you don't need to unset LD_LIBRARY_PATH for running Anaconda, but changing it in such a way Anaconda libraries come first.

Have you tried to do LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH? (not safe in genera, but it might help in this case)

What shell do you use? What error do you have if you run Anaconda without unsetting LD_LIBRARY_PATH? What is your value for LD_LIBRARY_PATH?

You can alias emacs to "LD_LIBRARY_PATH= emacs", so emacs with have the correct path, but most of your other binaries will be useless in that session.

Alternatively, you may alias anaconda binary to "LD_LIBRARY_PATH=. "

Why don't you do something like this:

alias emacs="LD_LIBRARY_PATH='whatever' sh -c 'echo \$HOME'"
alias emacs="LD_LIBRARY_PATH='whatever' bash -c '/usr/bin/emacs \${@:0}'"

Maybe you have to change the /usr/bin/emacs path.

I derived it from what I've tried with this:

alias asdf="HOME=asf bash -c 'echo \$HOME \${@:0}'"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!