michaelgale / cq-gridfinity

A python library to build parameterized gridfinity compatible objects such a baseplates and boxes.
MIT License
80 stars 5 forks source link

AttributeError: module 'numpy' has no attribute 'bool8' #11

Open alfredopalhares opened 1 week ago

alfredopalhares commented 1 week ago

Hello,

I now have this error in all the comands: AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?

-> % ruggedbox 5 4 6 --lid -f stl
Traceback (most recent call last):
  File "/home/masterkorp/.local/bin/ruggedbox", line 5, in <module>
    from cqgridfinity.scripts.ruggedbox import main
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/cqgridfinity/__init__.py", line 15, in <module>
    from .gf_obj import GridfinityObject
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/cqgridfinity/gf_obj.py", line 30, in <module>
    import cadquery as cq
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/cadquery/__init__.py", line 22, in <module>
    from .occ_impl import exporters
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/cadquery/occ_impl/exporters/__init__.py", line 10, in <module>
    from ...cq import Workplane
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/cadquery/cq.py", line 62, in <module>
    from .sketch import Sketch
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/cadquery/sketch.py", line 28, in <module>
    from .occ_impl.sketch_solver import (
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/cadquery/occ_impl/sketch_solver.py", line 3, in <module>
    from nptyping import NDArray as Array
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/nptyping/__init__.py", line 30, in <module>
    from nptyping.ndarray import NDArray
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/nptyping/ndarray.py", line 32, in <module>
    from nptyping.shape_expression import (
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/nptyping/shape_expression.py", line 35, in <module>
    from nptyping.typing_ import Literal
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/nptyping/typing_.py", line 66, in <module>
    Bool8: TypeAlias = np.bool8
                       ^^^^^^^^
  File "/home/masterkorp/.local/share/pipx/venvs/cqgridfinity/lib/python3.12/site-packages/numpy/__init__.py", line 410, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?

I have 0.5.6 installed.

-> % pipx list
venvs are in /home/masterkorp/.local/share/pipx/venvs
apps are exposed on your $PATH at /home/masterkorp/.local/bin
manual pages are exposed at /home/masterkorp/.local/share/man
   package cqgridfinity 0.5.6, installed using Python 3.12.4
    - gridfinitybase
    - gridfinitybox
    - ruggedbox

Any ideas on what this could be ?

michaelgale commented 1 week ago

This is caused by a CadQuery dependency on the version of numpy. See this issue for details: https://github.com/CadQuery/cadquery/issues/1626 I'm not familiar with how far the CadQuery team got to resolving this issue, but I suspect if you install a newer version of CadQuery then this will likely resolve it.