robotics-toolbox-python icon indicating copy to clipboard operation
robotics-toolbox-python copied to clipboard

import error, cannot import name plotvol3

Open slyandsmart opened this issue 1 year ago • 1 comments

Check here first

Common issues

Describe the bug

I try to use the toolbox, installed it via pip on my DOCKER Container but the following error appears when i try to work with.

import roboticstoolbox /usr/local/lib/python3.10/dist-packages/matplotlib/projections/init.py:63: UserWarning: Unable to import Axes3D. This may be due to multiple versions of Matplotlib being installed (e.g. as a system package and as a pip package). As a result, the 3D projection is not available. warnings.warn("Unable to import Axes3D. This may be due to multiple versions of " Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.10/dist-packages/roboticstoolbox/init.py", line 1, in from roboticstoolbox.tools import * File "/usr/local/lib/python3.10/dist-packages/roboticstoolbox/tools/init.py", line 2, in from roboticstoolbox.tools.p_servo import p_servo, angle_axis, angle_axis_python File "/usr/local/lib/python3.10/dist-packages/roboticstoolbox/tools/p_servo.py", line 4, in from spatialmath import SE3, base File "/usr/local/lib/python3.10/dist-packages/spatialmath/init.py", line 3, in from spatialmath.pose2d import SO2, SE2 File "/usr/local/lib/python3.10/dist-packages/spatialmath/pose2d.py", line 26, in import spatialmath.base as smb File "/usr/local/lib/python3.10/dist-packages/spatialmath/base/init.py", line 8, in from spatialmath.base.transforms3d import * # lgtm [py/polluting-import] File "/usr/local/lib/python3.10/dist-packages/spatialmath/base/transforms3d.py", line 48, in from spatialmath.base.graphics import plotvol3, axes_logic ImportError: cannot import name 'plotvol3' from 'spatialmath.base.graphics' (/usr/local/lib/python3.10/dist-packages/spatialmath/base/graphics.py)

Version information

Did you install from PyPI or GitHub? If PyPI what version number? roboticstoolbox-python==1.1.0 (but tried all the newer ones also) spatialmath-python==1.1.8 (but tried all the newer ones also )

Environment (please complete the following information): Ubuntu 22.04 Docker Container ( FROM osrf/ros:humble-desktop) Python 3.10.12

slyandsmart avatar Jul 04 '24 13:07 slyandsmart

If not using graphics, a hacky workaround is to just not import that line, i.e. in OP's example:

vi /usr/local/lib/python3.10/dist-packages/spatialmath/base/transforms3d.py

and comment out line 48

peteflorence avatar Jul 14 '24 16:07 peteflorence