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

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

Open
yurivict opened this issue Dec 27, 2023 · 6 comments

Comments

@yurivict
Copy link

>>> 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

@yurivict
Copy link
Author

yurivict commented Dec 28, 2023

The documentation says that numpy has bool_, not bool.

@kairusann
Copy link

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

@dlazares
Copy link

dlazares commented Mar 8, 2024

thanks @kairusann!
when pypi fix?

facebook-github-bot pushed a commit to facebookresearch/hot3d that referenced this issue May 2, 2024
Summary:
Updating instruction to install smplx python package.
Why installing them from git rather than pypi?
- It is to obtain most uptodate version

Additional note:
- chumpy (a smplx dependency) from GIT is mandatory to be sure to have a version working with recent numpy version (see mattloper/chumpy#55)

=> Details on how to download the MANO models from MANO website will come in a later more detailed instruction set.

Reviewed By: prithvirb

Differential Revision: D56836149

fbshipit-source-id: 07de4efe74a68d9a24df0108ec0f48ee5cbdb33c
@nubertj
Copy link

nubertj commented Aug 6, 2024

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).

@icedwater
Copy link

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.

@icedwater
Copy link

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 :)

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

5 participants