Wasserwecken / bvhio

Read, write, edit and create .bvh files with hierarchical 3D transforms
MIT License
47 stars 11 forks source link

TypeError: 'type' object is not subscriptable #20

Closed meghbhalerao closed 1 week ago

meghbhalerao commented 1 month ago

Hello, after I do pip install bvhio and try to 'import bvhio' I get the following error -

In [1]: import bvhio
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 import bvhio

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/bvhio/__init__.py:1
----> 1 from .lib.bvh import BvhContainer, BvhJoint
      2 from .lib.hierarchy import Joint
      3 from .lib.Parser import convertBvhToHierarchy, convertHierarchyToBvh, readAsHierarchy, readAsBvh, writeBvh, writeHierarchy

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/bvhio/lib/bvh/__init__.py:1
----> 1 from .BvhContainer import BvhContainer
      2 from .BvhJoint import BvhJoint

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/bvhio/lib/bvh/BvhContainer.py:1
----> 1 from .BvhJoint import BvhJoint
      4 class BvhContainer:
      5     """Container for the information of the bvh file.
      6 
      7     Root is the recursive definition of the skeleton.
   (...)
     10 
     11     Frams are the count of keyframes of the motion."""

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/bvhio/lib/bvh/BvhJoint.py:2
      1 import glm
----> 2 from SpatialTransform import Pose
      5 class BvhJoint:
      6     """Data structure for the bvh skeleton definition. Contains the attributes as in the BVH file.
      7 
      8     Keyframes contain the motion data."""

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/SpatialTransform/__init__.py:1
----> 1 from .lib.transform import Transform
      2 from .lib.pose import Pose
      3 from .lib.euler import Euler

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/SpatialTransform/lib/transform.py:5
      3 import random
      4 import string
----> 5 from .pose import Pose
      8 class Transform(Pose):
      9     """Spatial definition of an linear space with position, rotation and scale.
     10     - Based on 'Pose' class, extended with parent child relation ship propertis and methods.
     11     - Space is defined as right handed where -> Y+ is up, and X+ is right and Z- is forward.
     12     - Positive rotations are counter clockwise."""

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/SpatialTransform/lib/pose.py:2
      1 import glm
----> 2 from .euler import Euler
      5 class Pose:
      6     """Spatial definition of an linear space with position, rotation and scale.
      7     - ONLY provides properties and methods for local space.
      8     - There is no parent child relation between poses
      9     - Space is defined as right handed where -> Y+ is up, and X+ is right and Z- is forward.
     10     - Positive rotations are counter clockwise."""

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/SpatialTransform/lib/euler.py:8
      2 import glm
      5 # https://en.wikipedia.org/wiki/Euler_angles
----> 8 class Euler:
      9     """Static collection of conversions for euler angles.
     10 
     11     Matrices are expected to be column major, like glm.
     12     """
     14     def getOrders() -> list[str]:

File ~/anaconda3/envs/hrgym/lib/python3.8/site-packages/SpatialTransform/lib/euler.py:14, in Euler()
      8 class Euler:
      9     """Static collection of conversions for euler angles.
     10 
     11     Matrices are expected to be column major, like glm.
     12     """
---> 14     def getOrders() -> list[str]:
     15         """List of possible rotation orders in 3D space."""
     16         return list(['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'])

TypeError: 'type' object is not subscriptable

In [2]: TypeError: 'type' object is not subscriptable

My bvhio version is bvhio 1.4.6 pypi_0 pypi

I am on ubuntu 24.

could someone help on this issue? thanks!

Wasserwecken commented 1 month ago

Sorry for that late answer. I am at my limits right now. Do you just import the library or does the exception appear if you use the methods ob bvhio?

meghbhalerao commented 1 month ago

its just on the import bvhio

Wasserwecken commented 1 month ago

which python version are you using? I can use bvhio without problems. Also the CI run without problems...

Your problem is very confusing to me. I am sorry and without clue. Sadly Im using windows only, so i cannot confirm its a problem with your linux.

Have you tried to uninstall bvhio? Or the complete python environment? Have you tried to install bvhio on another computer? Just for testing