joblib 0.12 causes TypeError at import
mvollrath opened this issue · comments
Description
librosa fails to import with joblib 0.12 installed. Works with joblib 0.11.
Steps/Code to Reproduce
import librosa
Expected Results
No TypeError
Actual Results
File "...", line 19, in <module>
import librosa
File "/usr/local/lib/python2.7/dist-packages/librosa/__init__.py", line 12, in <module>
from . import core
File "/usr/local/lib/python2.7/dist-packages/librosa/core/__init__.py", line 104, in <module>
from .time_frequency import * # pylint: disable=wildcard-import
File "/usr/local/lib/python2.7/dist-packages/librosa/core/time_frequency.py", line 10, in <module>
from ..util.exceptions import ParameterError
File "/usr/local/lib/python2.7/dist-packages/librosa/util/__init__.py", line 67, in <module>
from .utils import * # pylint: disable=wildcard-import
File "/usr/local/lib/python2.7/dist-packages/librosa/util/utils.py", line 111, in <module>
def valid_audio(y, mono=True):
File "/usr/local/lib/python2.7/dist-packages/librosa/cache.py", line 49, in wrapper
if self.cachedir is not None and self.level >= level:
File "/usr/local/lib/python2.7/dist-packages/joblib/memory.py", line 847, in cachedir
DeprecationWarning, stacklevel=2)
TypeError: expected string or buffer
Versions
Linux-4.4.0-119-generic-x86_64-with-Ubuntu-16.04-xenial
('Python', '2.7.12 (default, Dec 4 2017, 14:50:18) \n[GCC 5.4.0 20160609]')
('NumPy', '1.14.3')
('SciPy', '1.1.0')
('librosa', '0.5.1')
Looks like joblib's deprecation warning is raising a TypeError
, not as gentle as they intended..
Yikes, thanks for catching this! It looks like the changelog for joblib isn't even up to date with 0.12. Any idea what the change was?
Ah, I see in the source. They renamed a parameter from cachedir
to location
. This is a relatively easy fix if we bump up the minimum version requirement. I can try to do this over the weekend and push out a quick point release.
Long term, we might want to rethink how the whole caching system works, or try to push the caching level functionality upstream to joblib.
I was able to work around this issue by removing joblib 0.12.0 and installing 0.11.0