Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with sklearn on installing by pip #54

Open
wook2014 opened this issue Sep 22, 2023 · 0 comments
Open

Error with sklearn on installing by pip #54

wook2014 opened this issue Sep 22, 2023 · 0 comments

Comments

@wook2014
Copy link

I am trying to install altanalyze in a conda environment on linux server. I tried to install directly by pip install AltAnalyze but there comes an error:

ERROR: Command errored out with exit status 1:
     command: /data/bioinf/jyuan/miniconda/altanalyse/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kzJa7S/sklearn/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kzJa7S/sklearn/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-mMZ7G6
         cwd: /tmp/pip-install-kzJa7S/sklearn/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-kzJa7S/sklearn/setup.py", line 9, in <module>
        with open("README.md", encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I tried to download the sklearn-0.0.post9.tar.gz , changed the line which occurs the problem according to:
https://stackoverflow.com/questions/12541370/typeerror-encoding-is-an-invalid-keyword-argument-for-this-function
from

with open("README.md", encoding='utf-8') as f:

to

import io
with io.open("README.md", encoding='utf-8') as f:

and install it before altanalyze but it seemed that sklearn is not supported now:

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

If the previous advice does not cover your use case, feel free to report it at
https://github.com/scikit-learn/sklearn-pypi-package/issues/new

Is there any update on scikit-learn to fix the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant