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

had to downgrade numpy from 2.0.0 to 1.26.4 to make cadquery work #1616

Closed
MotoCyti opened this issue Jun 28, 2024 · 5 comments · Fixed by #1617
Closed

had to downgrade numpy from 2.0.0 to 1.26.4 to make cadquery work #1616

MotoCyti opened this issue Jun 28, 2024 · 5 comments · Fixed by #1617

Comments

@MotoCyti
Copy link

new install of cadquery on windows 10. Cadquery version 2.4.0
using python 3.12.4
test of install with "import cadquery" produced an error: AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'
google search returned that latest numpy no longer has bool8.
So I downgraded numpy from 2.0.0 to 1.26.4
It solve the problem. basic cadquery test passed.

@drayde
Copy link

drayde commented Jul 10, 2024

#1617 did not fix the issue for me, there is still a problem with numpy2:

/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/cadquery/occ_impl/sketch_solver.py:10: in
import nlopt
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/nlopt/init.py:1: in
from .nlopt import *
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/nlopt/nlopt.py:20: in
from . import _nlopt
E ImportError: numpy.core.multiarray failed to import
------------------------------- Captured stderr --------------------------------

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

@adam-urbanczyk
Copy link
Member

How did you install? Via pip or conda?

@drayde
Copy link

drayde commented Jul 10, 2024

@adam-urbanczyk
Copy link
Member

Then I think you need to ask the maintainers of nlopt to build against numpy 2 and release.

@drayde
Copy link

drayde commented Jul 10, 2024

Yes, I think you are right. I'll use numpy<2 for now

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

Successfully merging a pull request may close this issue.

3 participants