Is it possible to set environment variables in Google's Colaboratory?

后端 未结 2 1462
没有蜡笔的小新
没有蜡笔的小新 2020-12-18 04:20

I am running some Python scripts in Google\'s Colaboratory platform. Now, I need to set some environment variables of the system. Like the following shows:

!         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 04:46

    I normally set the PATH with os.environ, like this:

    import os
    os.environ['PATH'] += ":/usr/local/go/bin"
    

提交回复
热议问题