6

I am trying to deploy a codebase that has a number numba.njit functions with cache=True.

It works fine running locally (Mac OS X 10.12.3), but on the remote machine (Ubuntu 14.04 on AWS) I am getting the following error:

RuntimeError at /portal/

cannot cache function 'filter_selection': 

no locator available for file:
'/srv/run/miniconda/envs/mbenv/lib/python2.7/site-packages/mproj/core_calcs/filter.py'

I looked through the numba codebase, and I saw this file: https://github.com/numba/numba/blob/master/numba/caching.py

It appears that the following function is returning None instead of a locator, for this exception to be raised

cls.from_function(py_func, source_path)

Guessing this is a permission to write the pycache folders, but I didn't see in the numba docs a way to specify the cache folder location (CACHE_DIR).

Has anyone hit this before, and if so, what is the suggested work-around?

Greg Jennings
  • 1,611
  • 16
  • 25
  • 3
    I'm not sure if this solves your problem, but there is a `NUMBA_CACHE_DIR` env variable: https://github.com/numba/numba/blob/d33dbb475f1851d70f2f0f983f9382d12a4042a4/numba/config.py#L121 – JoshAdel May 25 '17 at 15:20
  • 1
    Thanks Josh. I eventually got around this issue by changing the permissions of the user running the application to allow access to write the default directories, so I didn't check your suggestion. – Greg Jennings May 31 '17 at 09:39
  • 3
    Hi Greg, which permissions did you change. I'm trying to run some software which uses numba on work cluster and am getting a similar error. – JavNoor Jan 31 '18 at 23:12

1 Answers1

2

Set sys.frozen = True before for cls in self._locator_classes: in caching.py can eliminate the issue.

I have no idea whether such setting will impact performance.

slw287r
  • 21
  • 2