jdb78 / pytorch-forecasting

Time series forecasting with PyTorch
https://pytorch-forecasting.readthedocs.io/
MIT License
3.77k stars 600 forks source link

Partial import of sklearn during the build process - upon pip install #1328

Open dorienh opened 1 year ago

dorienh commented 1 year ago

Expected behavior

Trying to install pytorch_forecasting with pip3 install pytorch_forecasting, but I get an error:

Collecting scikit-learn<1.1,>=0.24 (from pytorch_forecasting)
  Using cached scikit-learn-1.0.2.tar.gz (6.7 MB)
  Installing build dependencies ...   Getting requirements to build wheel ...   Preparing metadata (pyproject.toml) ... error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [286 lines of output]
      Partial import of sklearn during the build process.
...
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
dorienh commented 1 year ago

Not sure what this was, for some reason it tried to install very low version of scikit-learn. I had this with a few kernels, finally, I installed a venv with Python 3.10.9 and that worked.

radu-gheorghe commented 8 months ago

Thanks so much, you saved my life 🙂 Not really my life, but you get it!

I thiiink that the problem is that the scikit-learn version that's referenced (1.0.2, I think) doesn't have a a macos wheel for Python 3.11 (at least not for arm64) so pip tries to build it and that fails. For 3.10, it seems to be there, because I get:

Collecting scikit-learn<2.0,>=1.2
  Downloading scikit_learn-1.3.2-cp310-cp310-macosx_12_0_arm64.whl (9.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.5/9.5 MB 9.9 MB/s eta 0:00:00

It doesn't seem to try to build anything.

Also, if it helps, this seems to be the same issue as #1385 and #1382

dorienh commented 1 month ago

It would be great if requirements could be updated to allow a newer scikit-learn we we can use Python 3.11