Numba环境变量未通过.numba_config.yaml设置 [英] Numba environment variable not set through .numba_config.yaml
本文介绍了Numba环境变量未通过.numba_config.yaml设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Some environment variables can be set for numba, as specified in the doc: https://numba.pydata.org/numba-doc/dev/reference/envvars.html
但是,在同一文件夹中启动python shell,我在os.environ
中看不到该变量:
However, launching a python shell in the same folder, I cannot see the variable in os.environ
:
In [1]: !cat .numba_config.yaml
warnings: 1
In [2]: import os; os.environ["NUMBA_WARNINGS"]
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-2-2d63c69434b7> in <module>
----> 1 import os; os.environ["NUMBA_WARNINGS"]
~/anaconda3/lib/python3.6/os.py in __getitem__(self, key)
667 except KeyError:
668 # raise KeyError with the original key value
--> 669 raise KeyError(key) from None
670 return self.decodevalue(value)
671
KeyError: 'NUMBA_WARNINGS'
(我已安装pyyaml,import yaml
不会产生错误)
(I have pyyaml installed, import yaml
does not yield an error)
推荐答案
您可以通过 os.environ
这篇关于Numba环境变量未通过.numba_config.yaml设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文