question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spatialmath import broken

See original GitHub issue

Trying to import the “base” attribute of the “spatialmath” module gives me an error message. I am trying to import it using the following statement at the beginning of a jupyter notebook: import spatialmath.base as tr

The error message is: `--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-3-96508624d92a> in <module> ----> 1 import spatialmath.base

~/test_prep_sem_3/viewpoints_generation/automated-part-inspection/.venv/lib/python3.6/site-packages/spatialmath/init.py in <module> ----> 1 from spatialmath.pose2d import SO2, SE2 2 from spatialmath.pose3d import SO3, SE3 3 from spatialmath.baseposematrix import BasePoseMatrix 4 from spatialmath.geom2d import Line2, Polygon2 5 from spatialmath.geom3d import Line3, Plane3

~/test_prep_sem_3/viewpoints_generation/automated-part-inspection/.venv/lib/python3.6/site-packages/spatialmath/pose2d.py in <module> 24 import numpy as np 25 —> 26 from spatialmath.base import argcheck 27 from spatialmath import base as base 28 from spatialmath.baseposematrix import BasePoseMatrix

~/test_prep_sem_3/viewpoints_generation/automated-part-inspection/.venv/lib/python3.6/site-packages/spatialmath/base/init.py in <module> 6 from spatialmath.base.quaternions import * # lgtm [py/polluting-import] 7 from spatialmath.base.transforms2d import * # lgtm [py/polluting-import] ----> 8 from spatialmath.base.transforms3d import * # lgtm [py/polluting-import] 9 from spatialmath.base.transformsNd import * # lgtm [py/polluting-import] 10 from spatialmath.base.vectors import * # lgtm [py/polluting-import]

~/test_prep_sem_3/viewpoints_generation/automated-part-inspection/.venv/lib/python3.6/site-packages/spatialmath/base/transforms3d.py in <module> 22 23 from spatialmath import base as smb —> 24 import spatialmath.base.symbolic as sym 25 26 _eps = np.finfo(np.float64).eps

AttributeError: module ‘spatialmath’ has no attribute ‘base’`

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
StephLincommented, Jul 17, 2022

Installing it using pip still results in the same error, but including the files from the master branch of the repository fixes the issue.

I think the issue here is not complicated. The current master branch already contains the patch #53 that should resolve the import problem, but the current version on pypi doesn’t yet.

In my opinion, maybe publishing a new version to pypi can make users easier to use this project with Python 3.6.

0reactions
petercorkecommented, Oct 9, 2022

sorry to have been slow here. A version of current master branch is now on PyPI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

import error · Issue #52 · petercorke/spatialmath-python - GitHub
It looks like spatialmath is somehow missing base attribute. I am working on Ubuntu 18.04.5 LTS via wsl2 on windows 11 ...
Read more >
Source code for spatialmath.base.transforms3d
pylint: disable=invalid-name import sys import math import numpy as np from collections.abc import Iterable from spatialmath import base as smb from ...
Read more >
Why does from scipy import spatial work ... - Stack Overflow
When you import a package, you don't actually load the modules inside, and thus package.module causes an error.
Read more >
Spatial math exercises and worksheets, in Braille and print
The problem of a lack of mathematical and scientific content in Braille, and the high cost of producing such material, are well known....
Read more >
Robot Hexapod Build Labs | SpringerLink
See Coding Segments 1 and 3 for help with this problem. ... #import requirements import spatialmath as sm import spatialmath.base as base ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found