os.environ.get('LOCAL_RANK')报错
时间: 2023-09-30 16:02:12 浏览: 295
Python基于os.environ从windows获取环境变量
5星 · 资源好评率100%
当使用os.environ.get('LOCAL_RANK')时,如果'LOCAL_RANK'这个环境变量不存在,则会返回None而不会报错。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [os.environ模块环境变量详解](https://blog.csdn.net/happyjacob/article/details/109279118)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文