noraeisner / LATTE

Lightcurve Analysis Tool for Transiting Exoplanet
GNU Lesser General Public License v3.0
39 stars 10 forks source link

Sklearn Deprecation #50

Closed Codeiology closed 2 months ago

Codeiology commented 7 months ago

I run Python3.11 on a MacOS Sonoma Macbook M1 (commandlinetools installed) and while running pip3 install tessLATTE: I get the following output:


DEPRECATION: Loading egg at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pdlist-0.1.0-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
DEPRECATION: Loading egg at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tessLATTE-1.0.2-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
DEPRECATION: Loading egg at /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/mock-5.1.0-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
Requirement already satisfied: tessLATTE in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tessLATTE-1.0.2-py3.11.egg (1.0.2)
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from tessLATTE) (1.26.4)
Requirement already satisfied: pandas in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from tessLATTE) (1.5.3)
Collecting seaborn (from tessLATTE)
  Using cached seaborn-0.13.2-py3-none-any.whl.metadata (5.4 kB)
Requirement already satisfied: requests in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from tessLATTE) (2.31.0)
Requirement already satisfied: lightkurve>1.2.0 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from tessLATTE) (2.4.2)
Collecting matplotlib==3.2.0 (from tessLATTE)
  Using cached matplotlib-3.2.0.tar.gz (40.5 MB)
  Preparing metadata (setup.py) ... done
Collecting astroplan (from tessLATTE)
  Using cached astroplan-0.10.tar.gz (140 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: astroquery in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages (from tessLATTE) (0.4.6)
Collecting sklearn (from tessLATTE)
  Using cached sklearn-0.0.post12.tar.gz (2.6 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      The 'sklearn' PyPI package is deprecated, use 'scikit-learn'
      rather than 'sklearn' for pip commands.

      Here is how to fix this error in the main use cases:
      - use 'pip install scikit-learn' rather than 'pip install sklearn'
      - replace 'sklearn' by 'scikit-learn' in your pip requirements files
        (requirements.txt, setup.py, setup.cfg, Pipfile, etc ...)
      - if the 'sklearn' package is used by one of your dependencies,
        it would be great if you take some time to track which package uses
        'sklearn' instead of 'scikit-learn' and report it to their issue tracker
      - as a last resort, set the environment variable
        SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True to avoid this error

      More information is available at
      https://github.com/scikit-learn/sklearn-pypi-package
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I was wondering if it is related to the .egg deprecation, but I tried creating a venv and got the same error. It just seems like sklearn is deprecated.

stelais commented 5 months ago

Yeah, since Dec 2022, sklearn got deprecated. setup.py should have scikit-learn instead

Codeiology commented 2 months ago

Thank you! It works for me now