locuslab / mpc.pytorch

A fast and differentiable model predictive control (MPC) solver for PyTorch.
https://locuslab.github.io/mpc.pytorch/
MIT License
872 stars 146 forks source link

Numpy Version Spec Causes Conda Issues for Env Export #42

Closed shieronymus-slingshot closed 1 year ago

shieronymus-slingshot commented 1 year ago

Hello,

I'm running into an error using the "mpc" package, installed via Pip, but in a Conda environment.

When trying to export the environment ("conda env export > env.yaml"), I get this error:

InvalidVersionSpec: Invalid version '1<2': invalid character(s)

The manual fix is to edit the /lib/python3.8/site-packages/mpc-0.0.4.dist-info/METADATA file, changing:

Requires-Dist: numpy (>=1<2)

to

Requires-Dist: numpy (>=1,<2)

It looks like this might be fixed in the code by changing line 14 of setup.py from 'numpy>=1<2', 'torch' to 'numpy>=1,<2', 'torch'.

Would you be willing to make this change and publish a new version?

Thank you, Seth

bamos commented 1 year ago

I just updated that line in https://github.com/locuslab/mpc.pytorch/commit/63732fa85ab2a151045493c4e67653210ca3d7ff, can you try re-installing it from git:

pip install git+git://github.com/locuslab/mpc.pytorch.git
shieronymus-slingshot commented 1 year ago

Thanks for the response and the fix -- I think this will work. I've tried installing a few ways... when building and then installing a wheel file, the particular METADATA file looks good and conda env export works.