mir-dataset-loaders / mirdata

Python library for working with Music Information Retrieval datasets
https://mirdata.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
357 stars 59 forks source link

ModuleNotFoundError: No module named 'smart_open' #623

Open bgenchel opened 7 months ago

bgenchel commented 7 months ago

2024 Macbook Pro M3 Max MacOS Sonoma 14.1 Python 3.10.4 via pyenv virtualenv

I installed mirdata via pip through a pyproject.toml file, and after installation, calling mirdata.initialize for any dataset generates the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "$HOME/.pyenv/versions/{pyenv-virtualenv-name}/lib/python3.10/site-packages/mirdata/__init__.py", line 53, in initialize
    module = importlib.import_module("mirdata.datasets.{}".format(dataset_name))
  File "/Users/benjamingenchel/.pyenv/versions/3.10.4/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "$HOME/.pyenv/versions/{pyenv-virtualenv-name}/lib/python3.10/site-packages/mirdata/datasets/slakh.py", line 35, in <module>
    from smart_open import open
ModuleNotFoundError: No module named 'smart_open'

I can install it separately, after which the call works, but that doesn't seem right. If it's necessary for the package to run it should be installed as a dependency.

tanmayy24 commented 7 months ago

Thank you for bringing this issue to our attention. It seems like there might be a missing dependency in the installation process for mirdata. Our apologies for any inconvenience this has caused. @guillemcortes

We'll look into this immediately to ensure that all necessary dependencies, including 'smart_open', are properly included in the installation process.

iranroman commented 2 months ago

I'm also having this problem.

iranroman commented 2 months ago

Also this, after manually installing smart_open.

python3.11/site-packages/jams/schema.py:193
    187         print('{:30s}\t{:40s}'.format(sch, desc))
    190 # Mapping of js primitives to numpy types
    191 __TYPE_MAP__ = dict(integer=np.int_,
    192                     boolean=np.bool_,
--> 193                     number=np.float_,
    194                     object=np.object_,
    195                     array=np.object_,
    196                     string=np.object_,
    197                     null=np.float_)
    200 def __get_dtype(typespec):
    201     '''Get the dtype associated with a jsonschema type definition
    202 
    203     Parameters
   (...)
    211         The associated dtype
    212     '''

python3.11/site-packages/numpy/__init__.py:397, in __getattr__(attr)
    394     raise AttributeError(__former_attrs__[attr])
    396 if attr in __expired_attributes__:
--> 397     raise AttributeError(
    398         f"`np.{attr}` was removed in the NumPy 2.0 release. "
    399         f"{__expired_attributes__[attr]}"
    400     )
    402 if attr == "chararray":
    403     warnings.warn(
    404         "`np.chararray` is deprecated and will be removed from "
    405         "the main namespace in the future. Use an array with a string "
    406         "or bytes dtype instead.", DeprecationWarning, stacklevel=2)

AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.