Conda set LD_LIBRARY_PATH for env only

前端 未结 2 457
迷失自我
迷失自我 2020-11-28 09:06

I have an installation of miniconda3 where I have created a virtual environment called py35. I have some libraries that I only want to use from within this environment. henc

2条回答
  •  广开言路
    2020-11-28 09:32

    I just wanted to add that you could declare 2 variables in the activate.d/env_vars.sh like, it makes it easier to reset the variable to the pre-activation state:

    export OLD_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
    export LD_LIBRARY_PATH=/your/path:${LD_LIBRARY_PATH}
    

    and then in deactivate.d/env_vars.sh:

    export LD_LIBRARY_PATH=${OLD_LD_LIBRARY_PATH}
    unset OLD_LD_LIBRARY_PATH
    

提交回复
热议问题