stan-dev / httpstan

HTTP interface to Stan, a package for Bayesian inference.
ISC License
40 stars 15 forks source link

unable to install latest stable httpstan (4.6.0) on latest stable python (3.10) on latest stable debian (11, bullseye) #582

Closed fcostin closed 2 years ago

fcostin commented 2 years ago

problem:

unable to install latest stable httpstan (4.6.0) on latest stable python (3.10) on latest stable debian (11, bullseye) from pypi using pip

symptom:

python3 -m pip install httpstan==4.6.0
ERROR: Could not find a version that satisfies the requirement httpstan==4.6.0 (from versions: 0.2.5, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.7.2, 0.7.3, 0.7.5, 0.7.6, 0.8.0, 0.9.0, 0.10.1)
ERROR: No matching distribution found for httpstan==4.6.0
WARNING: You are using pip version 21.2.4; however, version 21.3 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
The command '/bin/sh -c python3 -m pip install httpstan==4.6.0' returned a non-zero code: 1

likely cause:

latest httpstan wheels on pypi are built for cpython 3.7 -- 3.9, no wheels published for 3.10: https://pypi.org/project/httpstan/#files

workaround

downgrading python to the latest version which has published httpstan wheel releases on pypi (3.9.x) worked

full reproducible example

dev env: ubuntu 20.04 with docker 20.10.7

$ cat pystan.3.10.Dockerfile

FROM python:3.10.0-bullseye

# Need to install the updated gcc compiler (version 10) for Pystan 3
RUN echo 'deb http://deb.debian.org/debian testing main' >> /etc/apt/sources.list
RUN apt-get update -y
RUN apt-get install -y gcc
RUN rm -rf /var/lib/apt/lists/*

RUN python3 -m pip install httpstan==4.6.0

docker build -t pystan3.10:dev -f pystan.3.10.Dockerfile .

Sending build context to Docker daemon  3.072kB
Step 1/6 : FROM python:3.10.0-bullseye
 ---> c05c608cfa20
Step 2/6 : RUN echo 'deb http://deb.debian.org/debian testing main' >> /etc/apt/sources.list
 ---> Using cache
 ---> cb364266467c
Step 3/6 : RUN apt-get update -y
 ---> Using cache
 ---> 60bd55f7be49
Step 4/6 : RUN apt-get install -y gcc
 ---> Using cache
 ---> 6f6c11376f1b
Step 5/6 : RUN rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 204a2a9f5ad8
Step 6/6 : RUN python3 -m pip install httpstan==4.6.0
 ---> Running in 854aa31ee338
ERROR: Could not find a version that satisfies the requirement httpstan==4.6.0 (from versions: 0.2.5, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.6.0, 0.7.2, 0.7.3, 0.7.5, 0.7.6, 0.8.0, 0.9.0, 0.10.1)
ERROR: No matching distribution found for httpstan==4.6.0
WARNING: You are using pip version 21.2.4; however, version 21.3 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
The command '/bin/sh -c python3 -m pip install httpstan==4.6.0' returned a non-zero code: 1
riddell-stan commented 2 years ago

We have not released 3.10 wheels yet. I'm waiting until a macOS numpy bug gets fixed. (We release the macOS and Linux wheels together through an automated process.)

You should be able to build from source.

For future reference, I think we will aim to release httpstan wheels about one month after the release of a new Python version. It seems like this is likely enough time for all the minor issues to be resolved. Python 3.10 was released on Oct 4 (or thereabouts).

riddell-stan commented 2 years ago

Python 3.10 wheels are available.