Unable to get environment variables using os python

前端 未结 2 1440
甜味超标
甜味超标 2021-01-23 15:47

I recently created two environment variables in my terminal as shown below

export SPARK_HOME=\'/opt/spark/\'
export HAIL_HOME=\'/home/ABCD/.pyenv/versions/3.7.2/e         


        
相关标签:
2条回答
  • 2021-01-23 15:55

    I realized that it doesn't produce output for HAIL_HOME because it is installed in my virtual environment. (see .pyenv which is a hidden folder for my virtual environment`)

    However, if anyone can confirm this it's even better

    0 讨论(0)
  • 2021-01-23 16:09

    use os.environ.get("SPARK_HOME").

    0 讨论(0)
提交回复
热议问题