Elpy: LD_LIBRARY_PATH no match

Created on 9 Dec 2017  路  6Comments  路  Source: jorgenschaefer/elpy

Hi! I got a problem that with getenv command for LD_LIBRARY_PATH, prompts no match, I tried the method in #411, but still not work.

Question

Most helpful comment

I think that python shells inherit environment from Emacs, which inherits environment from the shell.
So if Emacs is run from bash (most probable case), adding:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/cc/Downloads/fast-rcnn/OpenCV/opencv/release/lib:/home/cc/Downloads/software/envs/py2/lib:/usr/local/cuda-7.5/lib64"
export PYTHONPATH="$PYTHONPATH:/home/cc/Downloads/caffe/python:/home/cc/Downloads/fast-rcnn/caffe-fast-rcnn/python"

to your '.bashrc' (then restarting Emacs) should be enough.

If you want to pollute your bash environment, you can specify environment variables to be loaded in python shell by customizing python-shell-process-environment.

Hope it helps.

All 6 comments

I manually set the path in init file:

(setenv "LD_LIBRARY_PATH"
  (concat
   "/home/cc/Downloads/fast-rcnn/OpenCV/opencv/release/lib" ";"
   "/home/cc/Downloads/software/envs/py2/lib" ";"
   "/usr/local/cuda-7.5/lib64" ";"
   (getenv "LD_LIBRARY_PATH")
  )
)

(setenv "PYTHONPATH"
(concat 
"/home/cc/Downloads/caffe/python" ";"
"/home/cc/Downloads/fast-rcnn/caffe-fast-rcnn/python" ";")
)

and it works, but problem is, how to set elpy to automatically load those PATH from somewhere, like shell?

I think that python shells inherit environment from Emacs, which inherits environment from the shell.
So if Emacs is run from bash (most probable case), adding:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/cc/Downloads/fast-rcnn/OpenCV/opencv/release/lib:/home/cc/Downloads/software/envs/py2/lib:/usr/local/cuda-7.5/lib64"
export PYTHONPATH="$PYTHONPATH:/home/cc/Downloads/caffe/python:/home/cc/Downloads/fast-rcnn/caffe-fast-rcnn/python"

to your '.bashrc' (then restarting Emacs) should be enough.

If you want to pollute your bash environment, you can specify environment variables to be loaded in python shell by customizing python-shell-process-environment.

Hope it helps.

@MrWanter Did this solve your issue ?

yes, I set the path in init file like this:

(setenv "LD_LIBRARY_PATH"
  (concat
   "/home/cc/Downloads/fast-rcnn/OpenCV/opencv/release/lib" ";"
   "/home/cc/Downloads/software/envs/py2/lib" ";"
   "/usr/local/cuda-7.5/lib64" ";"
   (getenv "LD_LIBRARY_PATH")
  )
)

(setenv "PYTHONPATH"
(concat 
"/home/cc/Downloads/caffe/python" ";"
"/home/cc/Downloads/fast-rcnn/caffe-fast-rcnn/python" ";")
)

Ok, Can we close this issue then ?

Please reopen if you need any additional information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mikeiwi picture mikeiwi  路  5Comments

chechoRP picture chechoRP  路  5Comments

SirSharpest picture SirSharpest  路  6Comments

kirk86 picture kirk86  路  5Comments

Valber picture Valber  路  4Comments