nextstrain / augur

Pipeline components for real-time phylodynamic analysis
https://docs.nextstrain.org/projects/augur/
GNU Affero General Public License v3.0
268 stars 128 forks source link

Can't install with Python ~3.11~ 3.12 on Conda #1334

Open victorlin opened 12 months ago

victorlin commented 12 months ago

EDIT: @joverlee521 mentioned that pyfastx is not the only issue. Seems like an overall issue with Python 3.11 in bioconda.


Original issue:

Current Behavior

Currently, trying to install Augur in a Conda environment with Python 3.11 pinned does not work.

% micromamba install augur
…
error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ augur is installable with the potential options
    …
    │  ├─ augur [18.2.0|19.0.0|...|23.1.0] would require
    │  │  └─ pyfastx >=0.8.4,<0.9  with the potential options
    │  │     ├─ pyfastx 0.8.4 would require
    │  │     │  └─ python >=3.10,<3.11.0a0 , which can be installed;
    │  │     ├─ pyfastx 0.8.4 would require
    │  │     │  └─ python >=3.6,<3.7.0a0 , which can be installed;
    │  │     ├─ pyfastx 0.8.4 would require
    │  │     │  └─ python >=3.7,<3.8.0a0 , which can be installed;
    │  │     ├─ pyfastx 0.8.4 would require
    │  │     │  └─ python >=3.8,<3.9.0a0 , which can be installed;
    │  │     └─ pyfastx 0.8.4 would require
    │  │        └─ python >=3.9,<3.10.0a0 , which can be installed;
    …
    └─ pin-1 is not installable because it requires
       └─ python 3.11.* , which conflicts with any installable versions previously reported.

Expected behavior

Augur should be installable with Python 3.11.

How to reproduce

# Set up a Conda env with Python 3.11
micromamba env create -n tmp
micromamba activate tmp
# Necessary on Apple silicon:
# export CONDA_SUBDIR=osx-64
micromamba install python=3.11

mamba install augur
# Observe error

Possible solution

Depend on a newer version of pyfastx. 0.8.4 is old and requires building when installed via pip on Python ≥3.10.

joverlee521 commented 11 months ago

Hmm, pyfastx is not the only issue, I just tried to install augur 23.1.1

$ micromamba install augur=23.1.1 -c bioconda
...
Pinned packages:
  - python 3.11.*

error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ augur 23.1.1**  is installable and it requires
    │  └─ bcbio-gff >=0.7.0,<0.8 , which requires
    │     └─ bx-python with the potential options
    │        ├─ bx-python [0.10.0|0.8.13|0.9.0] would require
    │        │  └─ python >=3.10,<3.11.0a0 , which can be installed;
    │        ├─ bx-python [0.10.0|0.8.10|...|0.9.0] would require
    │        │  └─ python >=3.8,<3.9.0a0 , which can be installed;
    │        ├─ bx-python [0.10.0|0.8.11|0.8.12|0.8.13|0.9.0] would require
    │        │  └─ python >=3.9,<3.10.0a0 , which can be installed;
    │        ├─ bx-python [0.7.1|0.7.2|...|0.8.9] would require
    │        │  └─ python [2.7* |>=2.7,<2.8.0a0 ], which can be installed;
    │        ├─ bx-python [0.8.1|0.8.2] would require
    │        │  └─ python [3.5* |>=3.5,<3.6.0a0 ], which can be installed;
    │        ├─ bx-python 0.8.1 would require
    │        │  └─ python 3.6* , which can be installed;
    │        ├─ bx-python [0.8.1|0.8.10|...|0.8.9] would require
    │        │  └─ python >=3.6,<3.7.0a0 , which can be installed;
    │        └─ bx-python [0.8.10|0.8.11|...|0.9.0] would require
    │           └─ python >=3.7,<3.8.0a0 , which can be installed;
    └─ pin-1 is not installable because it requires
       └─ python 3.11.* , which conflicts with any installable versions previously reported.

Seems like an overall issue with Python 3.11 in bioconda

victorlin commented 11 months ago

Oh! I should have checked before closing this issue with #1335. Thanks for re-opening.

corneliusroemer commented 6 months ago

See https://github.com/bioconda/bioconda-utils/pull/938 for occasional updates on the bioconda Python 3.11/3.12 status

aliciaaevans commented 4 months ago

pyfastx and bx-python have now been built for Python 3.11 and 3.12.

victorlin commented 4 months ago

@aliciaaevans thanks for the update! I just tried and confirmed all dependencies can be installed successfully on Python 3.11 (at least for osx-64):

CONDA_SUBDIR=osx-64 micromamba create -n tmp -c conda-forge -c bioconda augur python=3.11
genehack commented 4 months ago

Installing augur into an empty Conda environment currently results in that environment having python 3.11.9 installed. Trying to explicitly update that environment to python 3.12 fails due to pandas, pyfastx, and xopen all requiring python >= 3.11, < 3.12.0a0.

Relevant snippets of conda output:

│  ├─ augur [11.2.0|11.3.0|...|24.4.0] would require                                                                        14:49:10 [106/1674]
│  │  ├─ pandas >=1.0.0,<2  with the potential options
│  │  │  ├─ pandas [1.5.2|1.5.3] would require
│  │  │  │  └─ python >=3.11,<3.12.0a0 , which can be installed;
...
│  │  ├─ pyfastx >=1.0.0,<3  with the potential options
│  │  │  ├─ pyfastx 2.1.0 would require
│  │  │  │  └─ python >=3.11,<3.12.0a0 , which can be installed;
...
│  │  └─ xopen >=1.0.1,<2  with the potential options
│  │     ├─ xopen [1.6.0|1.7.0|1.8.0|1.9.0] would require
│  │     │  └─ python >=3.11,<3.12.0a0 , which can be installed;
...
└─ python 3.12  is not installable because it conflicts with any installable versions previously reported.
aliciaaevans commented 4 months ago

I think what is happening is the bioconda recipe for augur has version pins on many dependencies, so it's not picking up the latest versions that have builds for 3.12 and 3.11. I am guessing it doesn't need to be so tightly pinned and many of the version constraints can be removed or relaxed unless there is a specific issue known. Bioconda also has overall pinning for widely used dependencies.

victorlin commented 3 months ago

I am guessing it doesn't need to be so tightly pinned and many of the version constraints can be removed or relaxed unless there is a specific issue known.

This is being discussed and worked on in #1535.