Skip to content

'import chumpy' fails: ImportError: cannot import name 'bool' from 'numpy' #55

Open

Description

@yurivict
>>> import chumpy
/usr/local/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
/usr/local/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
/usr/local/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.str` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/chumpy/__init__.py", line 11, in <module>
    from numpy import bool, int, float, complex, object, unicode, str, nan, inf
ImportError: cannot import name 'bool' from 'numpy' (/usr/local/lib/python3.9/site-packages/numpy/__init__.py)
>>>

Version: 0.70
py39-numpy-1.25.0
Python-3.9
FreeBSD 14.0

Activity

  1. yurivict commented on Dec 28, 2023

    @yurivict
    Author

    The documentation says that numpy has bool_, not bool.

  2. kairusann commented on Dec 31, 2023

    @kairusann

    This issue was fixed recently but not yet sync up to PyPi (as discussed in #49), you can install the fixed version with pip install git+https://github.com/mattloper/chumpy

  3. dlazares commented on Mar 8, 2024

    @dlazares

    thanks @kairusann!
    when pypi fix?

  4. nubertj commented on Aug 6, 2024

    @nubertj

    would it be possible to update the pypi?
    The latest version in pypi is still 0.70, while the current master has 0.71 (which makes it hard to generate reproducible config files).

  5. icedwater commented on Sep 12, 2024

    @icedwater

    fwiw I worked around it by downgrading numpy from 1.26.4 to 1.23.0 which seems to still be OK for my purposes, but I'll try the git+https approach later.

  6. icedwater commented on Sep 13, 2024

    @icedwater

    fwiw I worked around it by downgrading numpy from 1.26.4 to 1.23.0 which seems to still be OK for my purposes, but I'll try the git+https approach later.

    git+https works, as expected. I was able to use numpy 2.0.2, for reference. If it's OK for you to downgrade numpy as I did, there are now two workarounds available :)

  7. lucasjinreal commented on Dec 5, 2025

    @lucasjinreal

    exec(code, locals())
    File "", line 11, in
    ModuleNotFoundError: No module named 'pip'
    [end of output]

  8. asrathore-ai commented on Dec 9, 2025

    @asrathore-ai

    exec(code, locals()) File "", line 11, in ModuleNotFoundError: No module named 'pip' [end of output]

    You are using some older chumpy, add pip install --no-build-isolation

  9. chris-rapson-hectre commented on Mar 12, 2026

    @chris-rapson-hectre

    This combination worked for me:

    • OS: Mac
    • python: 3.9
    • numpy: 2.0.2
    • chumpy: 0.7.0

    This seems like something that should be fixed urgently, since python3.9 is now end of life!

    Some linked issuea (#2899, #3218) recommend removing chumpy from the requirements, but when I tried that I got an error that mmcv depends on it.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions