How to set env variable in Jupyter notebook

前端 未结 8 880
时光取名叫无心
时光取名叫无心 2020-11-27 13:05

I\'ve a problem that Jupyter can\'t see env variable in bashrc file, is there a way to load these variables in jupyter or add custome variable to it?

8条回答
  •  臣服心动
    2020-11-27 13:25

    To set an env variable in a jupyter notebook, just use a % magic commands, either %env or %set_env, e.g., %env MY_VAR=MY_VALUE or %env MY_VAR MY_VALUE. (Use %env by itself to print out current environmental variables.)

    See: http://ipython.readthedocs.io/en/stable/interactive/magics.html

提交回复
热议问题