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.
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.
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:
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.