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 · 6 comments
Open

Error with sklearn on installing by pip #54

wook2014 opened this issue Sep 22, 2023 · 6 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?

@macoreL
Copy link

macoreL commented Sep 23, 2024

I came into the same issues. Is it fixed?

@nsalomonis
Copy link
Owner

nsalomonis commented Sep 23, 2024 via email

@ciel1021
Copy link

I am afraid this docker container is also not work as well. I tried to access it with singularity.

@frankligy
Copy link

Hi @ciel1021,

Could you elaborate on what issue you encounter when using the container? Some instructions on installation and how to use it are provided here:

install: https://snaf.readthedocs.io/en/latest/installation.html#step-1-altanalyze
run: https://snaf.readthedocs.io/en/latest/tutorial.html#running-altanalyze-to-identify-alternative-splicing-events

Best,
Frank

@ciel1021
Copy link

ciel1021 commented Sep 24, 2024

Hi @frankligy
basically I install the singularity by conda install and try to get the docker container. Here is the error message I got:

`singularity exec --bind /mnt/data1/home/jaquino altanalyze_0.7.0.1.sif altanalyze

INFO: Converting SIF file to temporary sandbox...

FATAL: "altanalyze": executable file not found in $PATH

INFO: Cleaning up image...

`
Thank you so much for your help, I appreciate your quick response.

@frankligy
Copy link

Hi @ciel1021,

Just to answer the installation and running docker container question.

First, when you pull the image from docker hub, since this is not a read-only image, you should use --sandbox and write it to a folder:

singularity build --sandbox altanalyze/ docker://frankligy123/altanalyze:0.7.0.1

instead of

singularity build altanalyze.sif docker://frankligy123/altanalyze:0.7.0.1

Then when you run the container, you should bind your host system to /mnt folder in virtual container, and use the writable folder instead of read-only sif:

singularity run -B $PWD:/mnt --writable altanalyze/ identify bam 4

There will be other caveats but these are the two I spotted from what I saw so far.

Best,
Frank

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

5 participants