compomics / DeepLC

DeepLC: Retention time prediction for (modified) peptides using Deep Learning.
https://iomics.ugent.be/deeplc
Apache License 2.0
52 stars 18 forks source link

pip install on Python 3.10 not working correctly #39

Closed levitsky closed 2 years ago

levitsky commented 2 years ago

Hi and thank you for the great package!

pip install deeplc behaves strangely on Python 3.10. It downloads mutltiple versions of deeplc:

pip install deeplc
Collecting deeplc
  Downloading deeplc-0.2.0-py3-none-any.whl (77.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.8/77.8 MB 2.1 MB/s eta 0:00:00
Requirement already satisfied: numpy<2,>=1.17 in /home/lev/venv/ms1/lib/python3.10/site-packages (from deeplc) (1.22.1)
Requirement already satisfied: setuptools>=42.0.1 in /home/lev/venv/ms1/lib/python3.10/site-packages (from deeplc) (59.6.0)
  Downloading deeplc-0.1.39-py3-none-any.whl (77.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.8/77.8 MB 1.3 MB/s eta 0:00:00
  Downloading deeplc-0.1.37-py3-none-any.whl (77.8 MB)
     ━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━ 25.8/77.8 MB 1.0 MB/s eta 0:00:51
... etc.

Any idea what the reason and the solution may be?

RobbinBouwmeester commented 2 years ago

Dear levitsky,

I have not seen that behavior before, will look into it and get back at you.

Kind regards,

Robbin

levitsky commented 2 years ago

Some context that might help: I also tried installing from Github like this:

pip install git+https://github.com/compomics/DeepLC
Collecting git+https://github.com/compomics/DeepLC
  Cloning https://github.com/compomics/DeepLC to /tmp/pip-req-build-4ekkzm3h
  Running command git clone --filter=blob:none --quiet https://github.com/compomics/DeepLC /tmp/pip-req-build-4ekkzm3h
  Resolved https://github.com/compomics/DeepLC to commit 2ed9de91f29a8a82eb7982f9a64d6dd1120a46eb
  Preparing metadata (setup.py) ... done
Requirement already satisfied: setuptools>=42.0.1 in ./venv/ms1/lib/python3.10/site-packages (from deeplc==0.2.0) (59.6.0)
ERROR: Could not find a version that satisfies the requirement tensorflow<3,>=2.2 (from deeplc) (from versions: 2.8.0rc0, 2.8.0rc1)
ERROR: No matching distribution found for tensorflow<3,>=2.2

However, directly running pip install tensorflow works and installs 2.8.0rc1. After that, I am able to install deeplc, both from Github or PyPI, however it fails when I import it or try to run deeplc:

The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.
Aborted (core dumped)
RalfG commented 2 years ago

Strange... I just tried a DeepLC install in a fresh Python 3.10 Conda environment, and pip installed it without issues. EDIT: also tried in a fresh docker container with the python:3.10 image, and also no problems there.

@levitsky, which pip version did you use?

RalfG commented 2 years ago

Regarding the AVX issue, it seems that your CPU is not supported by the tensorflow binaries installed from pip. You can try to build from source, or maybe conda?

levitsky commented 2 years ago

I will update this comment with more specific info, but it was several recent versions of pip on Linux in a clean virtualenv (not Conda).

levitsky commented 2 years ago

I am currently unable to reproduce my own report. pip install deeplc works fine. I noticed that it now installs Tensorflow 2.8.0, which was released today. I wonder if the problem was related to the fact that only a release candidate version was available before, and if it is in fact the reason, which package is responsible for this quirk.

RalfG commented 2 years ago

Very strange... DeepLC is pretty liberal with the tensorflow requirement, accepting anything between >=2.2 and <3.

RobbinBouwmeester commented 2 years ago

Great that is now working! Although I would like to know what caused the quirk... For now I will close this issue. Thank you again for the report!

levitsky commented 5 months ago

For extra information: a similar situation now occurs on Python 3.12, which is not supported by Tensorflow in official releases (2.15.0), so pip install deeplc fails with (excerpt):

ERROR: Cannot install deeplc==0.1.17, deeplc==0.1.18, deeplc==0.1.20, deeplc==0.1.22, deeplc==0.1.23, deeplc==0.1.24, deeplc==0.1.25, deeplc==0.1.26, deeplc==0.1.27, deeplc==0.1.28, deeplc==0.1.29, deeplc==0.1.30, deeplc==0.1.31, deeplc==0.1.32, deeplc==0.1.33, deeplc==0.1.34, deeplc==0.1.35, deeplc==0.1.36, deeplc==0.1.37, deeplc==0.1.39, deeplc==0.2.0, deeplc==0.2.1, deeplc==0.2.2, deeplc==1.0.0, deeplc==1.0.1, deeplc==1.1.1, deeplc==1.1.2, deeplc==1.2.0, deeplc==1.2.1, deeplc==2.0.0, deeplc==2.0.1, deeplc==2.0.2, deeplc==2.0.3, deeplc==2.0.4, deeplc==2.1.0, deeplc==2.1.1, deeplc==2.1.2, deeplc==2.1.3, deeplc==2.1.5, deeplc==2.1.6, deeplc==2.1.7, deeplc==2.1.8, deeplc==2.1.9, deeplc==2.2.0, deeplc==2.2.1, deeplc==2.2.10, deeplc==2.2.11, deeplc==2.2.12, deeplc==2.2.14, deeplc==2.2.16, deeplc==2.2.18, deeplc==2.2.19, deeplc==2.2.2, deeplc==2.2.20, deeplc==2.2.22, deeplc==2.2.23, deeplc==2.2.24, deeplc==2.2.25, deeplc==2.2.26, deeplc==2.2.27, deeplc==2.2.28, deeplc==2.2.3, deeplc==2.2.30, deeplc==2.2.31, deeplc==2.2.32, deeplc==2.2.4, deeplc==2.2.5, deeplc==2.2.6, deeplc==2.2.7, deeplc==2.2.8 and deeplc==2.2.9 because these package versions have conflicting dependencies.

The conflict is caused by:
    deeplc 2.2.32 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.31 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.30 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.28 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.27 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.26 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.25 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.24 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.23 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.22 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.20 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.19 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.18 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.16 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.14 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.12 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.11 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.10 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.9 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.8 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.7 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.6 depends on tensorflow<2.13.0 and >=2.2
    deeplc 2.2.5 depends on tensorflow<3 and >=2.2
    deeplc 2.2.4 depends on tensorflow<3 and >=2.2
    deeplc 2.2.3 depends on tensorflow<3 and >=2.2
    deeplc 2.2.2 depends on tensorflow<3 and >=2.2
    deeplc 2.2.1 depends on tensorflow<3 and >=2.2
    deeplc 2.2.0 depends on tensorflow<3 and >=2.2
    deeplc 2.1.9 depends on tensorflow<3 and >=2.2
    deeplc 2.1.8 depends on tensorflow<3 and >=2.2
    deeplc 2.1.7 depends on tensorflow<3 and >=2.2
    deeplc 2.1.6 depends on tensorflow<3 and >=2.2
    deeplc 2.1.5 depends on tensorflow<3 and >=2.2
    deeplc 2.1.3 depends on tensorflow<3 and >=2.2
    deeplc 2.1.2 depends on tensorflow<3 and >=2.2
    deeplc 2.1.1 depends on tensorflow<3 and >=2.2
    deeplc 2.1.0 depends on tensorflow<3 and >=2.2
    deeplc 2.0.4 depends on tensorflow<3 and >=2.2
    deeplc 2.0.3 depends on tensorflow<3 and >=2.2
    deeplc 2.0.2 depends on tensorflow<3 and >=2.2
    deeplc 2.0.1 depends on tensorflow<3 and >=2.2
    deeplc 2.0.0 depends on tensorflow<3 and >=2.2
    deeplc 1.2.1 depends on tensorflow<3 and >=2.2
    deeplc 1.2.0 depends on tensorflow<3 and >=2.2
    deeplc 1.1.2 depends on tensorflow<3 and >=2.2
    deeplc 1.1.1 depends on tensorflow<3 and >=2.2
    deeplc 1.0.1 depends on tensorflow<3 and >=2.2
    deeplc 1.0.0 depends on tensorflow<3 and >=2.2
    deeplc 0.2.2 depends on tensorflow<3 and >=2.2
    deeplc 0.2.1 depends on tensorflow<3 and >=2.2
    deeplc 0.2.0 depends on tensorflow<3 and >=2.2
    deeplc 0.1.39 depends on tensorflow<3 and >=2.2
    deeplc 0.1.37 depends on tensorflow<3 and >=2.2
    deeplc 0.1.36 depends on tensorflow<3 and >=2.2
    deeplc 0.1.35 depends on tensorflow<3 and >=2.2
    deeplc 0.1.34 depends on tensorflow<3 and >=2.2
    deeplc 0.1.33 depends on tensorflow<3 and >=2.2
    deeplc 0.1.32 depends on tensorflow<3 and >=2.2
    deeplc 0.1.31 depends on tensorflow<3 and >=2.2
    deeplc 0.1.30 depends on tensorflow<3 and >=2.2
    deeplc 0.1.29 depends on tensorflow<3 and >=2.2
    deeplc 0.1.28 depends on tensorflow<3 and >=2.2
    deeplc 0.1.27 depends on tensorflow<3 and >=2.2
    deeplc 0.1.26 depends on tensorflow<3 and >=2.2
    deeplc 0.1.25 depends on tensorflow<3 and >=2.2
    deeplc 0.1.24 depends on tensorflow<3 and >=2.2
    deeplc 0.1.23 depends on tensorflow<3 and >=2.2
    deeplc 0.1.22 depends on tensorflow<3 and >=2.2
    deeplc 0.1.20 depends on tensorflow<3 and >=2.2
    deeplc 0.1.18 depends on tensorflow~=2.3
    deeplc 0.1.17 depends on tensorflow~=2.3

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

but a direct pip install tensorflow command installs 2.16.0rc0. After that, pip install deeplc installs an old version 2.2.5 instead of the latest version 2.2.27.