Skip to content
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

cannot cache function: no locator available #290

Closed
berceanu opened this issue Nov 6, 2020 · 3 comments · Fixed by #300
Closed

cannot cache function: no locator available #290

berceanu opened this issue Nov 6, 2020 · 3 comments · Fixed by #300

Comments

@berceanu
Copy link
Contributor

berceanu commented Nov 6, 2020

Using openPMD_viewer-1.0.1/dev and numba 0.51.2 inside a Python 3.8 miniconda environment, I get

from openpmd_viewer import ParticleTracker
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/openPMD_viewer-1.0.1-py3.8.egg/openpmd_viewer/__init__.py", line 9, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/openPMD_viewer-1.0.1-py3.8.egg/openpmd_viewer/openpmd_timeseries/__init__.py", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/openPMD_viewer-1.0.1-py3.8.egg/openpmd_viewer/openpmd_timeseries/main.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible
  File "<frozen zipimport>", line 259, in load_module
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/openPMD_viewer-1.0.1-py3.8.egg/openpmd_viewer/openpmd_timeseries/utilities.py", line 223, in <module>
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/numba/core/decorators.py", line 211, in wrapper
    disp.enable_caching()
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/numba/core/dispatcher.py", line 743, in enable_caching
    self._cache = FunctionCache(self.py_func)
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/numba/core/caching.py", line 620, in __init__
    self._impl = self._impl_class(py_func)
  File "/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/numba/core/caching.py", line 355, in __init__
    raise RuntimeError("cannot cache function %r: no locator available "
RuntimeError: cannot cache function 'histogram_cic_1d': no locator available for file '/data/storage/berceanu/software/pkg/minicondapic/lib/python3.8/site-packages/openPMD_viewer-1.0.1-py3.8.egg/openpmd_viewer/openpmd_timeseries/utilities.py'
@berceanu
Copy link
Contributor Author

berceanu commented Nov 6, 2020

I installed openPMD-viewer by doing python setup.py install, so this might be relevant numba/numba#4908

@ax3l
Copy link
Member

ax3l commented Nov 6, 2020

Yes, pip install . is definitely what you want to go with [credit @hightower8083 here] - it will generally have more logic included than calling just calling the setup python scripts.

Numba is a quite complex dependency and setuptools (aka calling setup.py) does not resolve all install logic necessarily - pip does.

is there a place in the openPMD-viewer docs where we write python setup.py install? If that is the case, please let us replace such occurrences for local builds with the modern and future-safe:

pip wheel .
pip install *whl

Sorry for this, this is something coming down from PyPA.

Important note: always update pip first, please. There are numerous breaking changes that landed and will land in the near future in pip that will affect most of the Python eco-system (keywords: PEP517, dependency resolver, etc.). We will try to stay ahead of the curve if you encounter issues with the latest pip releases (please report if so).

@berceanu
Copy link
Contributor Author

berceanu commented Nov 6, 2020

is there a place in the openPMD-viewer docs where we write python setup.py install

Yes, inside CONTRIBUTING.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants