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

OSError: [Errno 36] File name too long when importing dcor #31

Closed
Quentin62 opened this issue Oct 13, 2021 · 5 comments
Closed

OSError: [Errno 36] File name too long when importing dcor #31

Quentin62 opened this issue Oct 13, 2021 · 5 comments

Comments

@Quentin62
Copy link

Quentin62 commented Oct 13, 2021

Importing dcor failed due to file name too long.

Ubuntu 20.04
python 3.8.10
dcor 0.5.3
numba 0.53.1 (+ 0.54.1)

>>> import dcor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/quentin/.local/lib/python3.8/site-packages/dcor/__init__.py", line 14, in <module>
    from . import independence  # noqa
  File "/home/quentin/.local/lib/python3.8/site-packages/dcor/independence.py", line 11, in <module>
    from ._dcor import u_distance_correlation_sqr
  File "/home/quentin/.local/lib/python3.8/site-packages/dcor/_dcor.py", line 26, in <module>
    from ._fast_dcov_mergesort import _distance_covariance_sqr_mergesort_generic
  File "/home/quentin/.local/lib/python3.8/site-packages/dcor/_fast_dcov_mergesort.py", line 208, in <module>
    _distance_covariance_sqr_mergesort_generic_impl_compiled = numba.njit(
  File "/home/quentin/.local/lib/python3.8/site-packages/numba/core/decorators.py", line 221, in wrapper
    disp.compile(sig)
  File "/home/quentin/.local/lib/python3.8/site-packages/numba/core/dispatcher.py", line 891, in compile
    cres = self._cache.load_overload(sig, self.targetctx)
  File "/home/quentin/.local/lib/python3.8/site-packages/numba/core/caching.py", line 644, in load_overload
    return self._load_overload(sig, target_context)
  File "/home/quentin/.local/lib/python3.8/site-packages/numba/core/caching.py", line 651, in _load_overload
    data = self._cache_file.load(key)
  File "/home/quentin/.local/lib/python3.8/site-packages/numba/core/caching.py", line 495, in load
    overloads = self._load_index()
  File "/home/quentin/.local/lib/python3.8/site-packages/numba/core/caching.py", line 511, in _load_index
    with open(self._index_path, "rb") as f:
OSError: [Errno 36] File name too long: '/home/quentin/.local/lib/python3.8/site-packages/dcor/__pycache__/_fast_dcov_mergesort._generate_distance_covariance_sqr_mergesort_generic_impl.locals._distance_covariance_sqr_mergesort_generic_impl-163.py38.nbi'
@vnmabus
Copy link
Owner

vnmabus commented Oct 13, 2021

Which version of Numba are you using?

@Quentin62
Copy link
Author

I have numba version 0.53.1. I tried with the latest (0.54.1) and I still have the same error.

@vnmabus
Copy link
Owner

vnmabus commented Oct 14, 2021

Unfortunately, Numba uses very long names for the cache files. Also, your filesystem seems to accept less length than others.

The only "solution" I can recommend to you is to use the environment variable NUMBA_CACHE_DIR in order to place the files in a more shallow path and hope that is enough (see https://numba.pydata.org/numba-doc/dev/reference/envvars.html#numba-envvars-caching).

@vnmabus
Copy link
Owner

vnmabus commented Oct 12, 2022

Note also that if your Windows is up-to-date, you may be able to request that longer paths are accepted:
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later.

@vnmabus
Copy link
Owner

vnmabus commented Dec 9, 2022

I suppose you solved your problem, so I will close this issue. Please reopen it if the problem persists.

@vnmabus vnmabus closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants