2

Some environment variables can be set for numba, as specified in the doc: https://numba.pydata.org/numba-doc/dev/reference/envvars.html

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'

(I have pyyaml installed, import yaml does not yield an error)

P. Camilleri
  • 12,664
  • 7
  • 41
  • 76

1 Answers1

2

You can get and set environment variables via os.environ

BlackBear
  • 22,411
  • 10
  • 48
  • 86