Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Building with numpy > 2?#473

AnsweredbyPhilFreeman
PhilFreeman asked this question inQ&A
Discussion options

I'm working on a project where I'd like both Robotics Toolbox and some other modules that depend on numpy > 2. I'm throwing errors on the fact that spatialmath requires numpy < 2. Is there a way to rebuild spatialmath and spatialgeometry with new versions of numpy? I've forked the repos and tried rebuilding them, but I'm not super familiar with where to change the dependency so that the build tools don't just grab numpy 1.xx again. I'm working from a virtual environment, so I'm good to trash whatever.

I'd love some guidance, and would even be willing to write a doc for the community on how to solve the problem if I work it out.

You must be logged in to vote

I worked out a method that works for me.

First, I rebuilt the wheels for spatialmath, spatialgeometry, and swift to use numpy 2.2.2. This involved removing the version restrictions in the pyproject.toml files, including replacing references to "oldest-supported-numpy" with simply "numpy". I then rebuilt all three modules with numpy 2.2.2.

Within a clone of the roboticstoolbox working director, I pip installed the resulting wheels into the virtual environment. In the filemobile/DistanceTransformPlanner.py I removed line 5:from numpy import disp which was unused anyway. I then rebuilt the roboticstoolbox wheel. Finally, I installed these four wheels (spatialmath, spatialgeometry, swift-si…

Replies: 1 comment 3 replies

Comment options

I worked out a method that works for me.

First, I rebuilt the wheels for spatialmath, spatialgeometry, and swift to use numpy 2.2.2. This involved removing the version restrictions in the pyproject.toml files, including replacing references to "oldest-supported-numpy" with simply "numpy". I then rebuilt all three modules with numpy 2.2.2.

Within a clone of the roboticstoolbox working director, I pip installed the resulting wheels into the virtual environment. In the filemobile/DistanceTransformPlanner.py I removed line 5:from numpy import disp which was unused anyway. I then rebuilt the roboticstoolbox wheel. Finally, I installed these four wheels (spatialmath, spatialgeometry, swift-sim, roboticstoolbox) into my project directory's virtual environment which had numpy 2.2.2.

I'll make my forks of the projects public if anybody wants to clone them and build their own wheels. The build command I used for each project waspython -m build --wheel

I should note that I wasn't able to run the test suite on rtb. I kept getting the same numpy module error. However, I'm not sure it matters. Caveat emptor. Unless I can assure myself that all the tests run, I'm not going to submit a pull request on these changes.

@petercorke, if you'd like me to clean up my forks, ensure all tests run/pass, and make the pull requests to the various repos, I can put a weekend into that in the not too distant future.

You must be logged in to vote
3 replies
@tooflesswulf
Comment options

Hey Phil, I tried to reproduce your build steps and it seems you forgot to removefrom numpy import disp frommobile/DistanceTransformPlanner.py : Line 5.

Aside from that, thanks for the fix!

@PhilFreeman
Comment options

Glad you were able to get it to work!

@PhilFreeman
Comment options

I pushed the change to my fork so that the deprecatedfrom numpy import disp is commented out.

Answer selected byPhilFreeman
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@PhilFreeman@tooflesswulf

[8]ページ先頭

©2009-2025 Movatter.jp