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

ModuleNotFoundError: No module named 'smart_open' #623

Open
bgenchel opened this issue Feb 8, 2024 · 3 comments
Open

ModuleNotFoundError: No module named 'smart_open' #623

bgenchel opened this issue Feb 8, 2024 · 3 comments

Comments

@bgenchel
Copy link

bgenchel commented Feb 8, 2024

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
Copy link
Collaborator

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
Copy link
Contributor

I'm also having this problem.

@iranroman
Copy link
Contributor

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.

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

3 participants