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

import error, cannot import name plotvol3 #449

Open
slyandsmart opened this issue Jul 4, 2024 · 1 comment
Open

import error, cannot import name plotvol3 #449

slyandsmart opened this issue Jul 4, 2024 · 1 comment

Comments

@slyandsmart
Copy link

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

@peteflorence
Copy link

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

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

No branches or pull requests

2 participants