Closed Wasserwecken closed 1 year ago
Hi there @Wasserwecken,
the issue is that you are using the library "glm" alongside "PyGLM" inside https://github.com/Wasserwecken/spatial-transform/blob/main/requirements.txt .
For whatever reason, Python packages distributed over the PyPI do not have to have the same module name.
In the case of PyGLM, the package is called PyGLM and contains two modules:
"glm" and "glm-stubs".
However, the package glm also contains a module called "glm". Thus the python interpreter doesn't know which one to use if you direct it to import glm
. In this case, it uses the one from the "glm" package.
It is not currently possible to use the two packages alongside each other (as far as I'm concerned).
Distributing PyGLM this way was a decision I made when I was still very inexperienced with the PyPI and I am contemplating changing the package structure.
Then you would have to use the following import command: from PyGLM import glm
I'm assuming you meant to only put PyGLM
into your requirements file, so to fix the issue you've mentioned, just remove this line: https://github.com/Wasserwecken/spatial-transform/blob/main/requirements.txt#L1
Thanks for that lighning fast answer.
Yes this was the error. Removing the 'glm' requirement solves the problem!
The requirements.txt was generated with:
python -m pipreqs.pipreqs --force
Don't know what that glm package is and where it appeard.
I've created a ci workflow and tests for my libary: https://github.com/Wasserwecken/spatial-transform
Tests are all running on my local windows(11) machine with python 3.9. But they fail all with the same error on wsl and GitHub CI.
Does have PyGLM some extra requirements? You can check the CI file on the repo if needed: https://github.com/Wasserwecken/spatial-transform/blob/main/.github/workflows/python-package.yml
WSL ubuntu 22.04
EEEE
ERROR: test_euler (unittest.loader._FailedTest)
ImportError: Failed to import test module: test_euler Traceback (most recent call last): File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\unittest\loader.py", line 436, in _find_test_path module = self._get_module_from_name(name) File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\unittest\loader.py", line 377, in _get_module_from_name import(name) File "D:\a\spatial-transform\spatial-transform\SpatialTransform\tests\test_euler.py", line 4, in
from SpatialTransform import Euler
File "D:\a\spatial-transform\spatial-transform\SpatialTransform__init__.py", line 1, in
from .lib.transform import Transform
File "D:\a\spatial-transform\spatial-transform\SpatialTransform\lib\transform.py", line 5, in
from .euler import Euler
File "D:\a\spatial-transform\spatial-transform\SpatialTransform\lib\euler.py", line 8, in
class Euler:
File "D:\a\spatial-transform\spatial-transform\SpatialTransform\lib\euler.py", line 18, in Euler
def toQuatFrom(radians: glm.vec3, order: str = 'ZXY', extrinsic: bool = True) -> glm.quat:
AttributeError: module 'glm' has no attribute 'vec3'