PyPSA / linopy

Linear optimization with N-D labeled arrays in Python
https://linopy.readthedocs.io
MIT License
155 stars 43 forks source link

0.3.12 ModuleNotFoundError: No module named 'highspy' #320

Closed michalmarszal closed 2 weeks ago

michalmarszal commented 2 weeks ago

@FabianHofmann 0.3.12 released on pypi.org forces to have highspy installed, without having it added to dependency in pyproject.toml. I do not see point of installing HiGHS when I am using the other solver. This is cased by small import in linopy/io.py:20 which is used just for typing hint See PR to fix the issue: https://github.com/PyPSA/linopy/pull/319

FabianHofmann commented 2 weeks ago

Hey @michalmarszal, highspy is a dependancy as it is used for writing mps files to disk

michalmarszal commented 2 weeks ago

But it is not listed as a "vanilla" dependency in pyproject.toml !!!! https://github.com/PyPSA/linopy/blob/f25f208daaff1ef5f5aae916f937eca4df0685fa/pyproject.toml#L22 It is listed as optional dependency.

Hence when i'm importing linopy in other projects using dependency pyproject.toml i got Module Not Found Error. Ergo i am not able to use linopy without HIGHS!

FabianHofmann commented 2 weeks ago

gotcha, thanks for raising