-
Notifications
You must be signed in to change notification settings - Fork 132
Description
Describe the bug
The package fails to import due to a missing dependency. Specifically, elastica.rod.cosserat_rod attempts to import Self from typing_extensions, but typing_extensions is not automatically installed as a dependency when installing PyElastica.
To Reproduce
I installed a package that depends on PyElastica (and thus installed PyElastica). When attempting to run a basic import script, it crashes.
Script:
# run.py
import elastica as eaError:
Traceback (most recent call last):
File "/Users/hschang/Desktop/RigidBodyRobotics/examples/rotation_energy_test/run.py", line 5, in <module>
import elastica as ea
File "/Users/hschang/Desktop/RigidBodyRobotics/.venv/lib/python3.12/site-packages/elastica/__init__.py", line 11, in <module>
from elastica.rod.cosserat_rod import CosseratRod
File "/Users/hschang/Desktop/RigidBodyRobotics/.venv/lib/python3.12/site-packages/elastica/rod/cosserat_rod.py", line 3, in <module>
from typing_extensions import Self
ModuleNotFoundError: No module named 'typing_extensions'
Environment
- Python version: 3.12
- OS: macOS
- Package Manager: uv (and standard pip)
- Numpy/numba version: "numpy 2.3.5 / numba 0.63.1"
- PyElastica version: pyelastica @ git+https://github.com/GazzolaLab/PyElastica.git@update-v1
Expected behavior
import elastica should execute successfully without requiring the user to manually install internal dependencies. The typing_extensions library should be listed in the install_requires of the package configuration.
Additional context
I was able to resolve this locally by manually installing the missing module:
uv add typing-extensions
# OR
pip install typing-extensionsThis suggests that typing-extensions is missing from the package's dependencies list in pyproject.toml.