Wie man nptyping AttributeError behebt: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?
Problem
Beim Ausführen Ihres Python-Skripts sehen Sie eine Fehlermeldung wie
nptyping_numpy_error.txt
File "/home/uli/.local/lib/python3.12/site-packages/cadquery/sketch.py", line 28, in <module>
from .occ_impl.sketch_solver import (
File "/home/uli/.local/lib/python3.12/site-packages/cadquery/occ_impl/sketch_solver.py", line 3, in <module>
from nptyping import NDArray as Array
File "/home/uli/.local/lib/python3.12/site-packages/nptyping/__init__.py", line 30, in <module>
from nptyping.ndarray import NDArray
File "/home/uli/.local/lib/python3.12/site-packages/nptyping/ndarray.py", line 32, in <module>
from nptyping.shape_expression import (
File "/home/uli/.local/lib/python3.12/site-packages/nptyping/shape_expression.py", line 35, in <module>
from nptyping.typing_ import Literal
File "/home/uli/.local/lib/python3.12/site-packages/nptyping/typing_.py", line 66, in <module>
Bool8: TypeAlias = np.bool8
^^^^^^^^
File "/home/uli/.local/lib/python3.12/site-packages/numpy/__init__.py", line 414, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?Lösung
Aktualisieren Sie nptyping
upgrade_nptyping.sh
pip install -U nptypingDanach sollte Ihr Skript wie erwartet funktionieren.
Check out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow