-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: cannot cache function 'square': no locator available for file #4908
Comments
Another workaround is to add |
Indeed, the issue seems to be this line: Line 188 in 0db8a2b
My use case is including an egg with a PySpark job, which will be copied to executors running my numba code. I don't have the option to I was considering monkey patching Line 328 in 0db8a2b
Ultimately I decided on some magic inside my own package, where I infer if my package was imported as a zip/egg, and if so I unzip the package, modify |
For most users working with docker images setting |
Just to confirm, because this never got a response from a maintainer before, this is still an issue with numba
I'm going to add this to the 0.57RC milestone as I think it's very tight to get anything into 0.56, but I do think it's important to look at resolving this. |
Hi @gmarkall, when is the numba 0.57 release expected to come out ? I'm facing the same issue in one of my projects and wanted to plan my work around the release timeline. Also, please let me know if there is a workaround/alternate solution to this issue. |
I'd guess we're at least 6 months out from 0.57. Workarounds from this issue seem to be:
If you go with the monkey patch route, I would imagine the locator class that gets monkey patched into the list of cache locators would probably be suitable to add to Numba permanently as a PR - if you go with this, please do let me know and we can work towards a PR. |
Seems numba caching issue is happening when using package timezonefinder under pyspark. Issue reference: jannikmi/timezonefinder#206 (comment) |
I am having this problem when this Docker container (https://github.com/BioContainers/containers/edit/master/cellpose/2.2.2/Dockerfile) that uses Does anyone have any suggestion how to fix the Docker container to also work in hosted singularity tests? |
For people coming from Google search:
|
When trying to import a numba-cached function from a python egg package, I get the following error message about no cache file locator being found:
The bug occurs at least with numba versions 0.45.1 and 0.46.1.
The bug appears to be operating system-agnostic.
Exporting a user cache directory does not help:
export NUMBA_CACHE_DIR=/tmp
.I believe that the various caching file locators fail because they assume that the python files are located in plain directories, when they can in fact be in an egg, for example here:
To produce a minimal package and reproduce this bug, run this code in a shell:
Or alternatively, if you do not trust this base64-encoded zip-file, you can create a package manually. The directory structure is:
The content of the file
mymodule.py
is:The content of the file
setup.py
is:The file
__init__.py
is empty.Often it might be preferable to compile the functions ahead of time during setup with
numba.pycc
if the required features are available (e.g. noparallel=True
(yet)).Another workaround is to install the package with
pip install .
, which will not create an egg, instead ofpython setup.py install
.The text was updated successfully, but these errors were encountered: