zoj613 / htnorm

Fast and Exact Simulation of Hyperplane-Truncated Multivariate Normal Distributions, with C, Python and R interfaces.
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

Error installing on linux via pip #30

Closed Dingel321 closed 1 year ago

Dingel321 commented 1 year ago

Hi everyone, i tried to install the package via pip. But i get the following error :

            error: Command "gcc -pthread -B /home/dingeldein/anaconda3/envs/cryo_sbi/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/dingeldein/anaconda3/envs/cryo_sbi/include -fPIC -O2 -isystem /home/dingeldein/anaconda3/envs/cryo_sbi/include -fPIC -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DSCIPY_MKL_H -DHAVE_CBLAS -I/usr/local/include -I/usr/include -I/home/dingeldein/anaconda3/envs/cryo_sbi/include -Ibuild/src.linux-x86_64-3.10/numpy/core/src/umath -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.10/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/home/dingeldein/anaconda3/envs/cryo_sbi/include/python3.10 -Ibuild/src.linux-x86_64-3.10/numpy/core/src/common -Ibuild/src.linux-x86_64-3.10/numpy/core/src/npymath -c build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.c -o build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.o -MMD -MF build/temp.linux-x86_64-cpython-310/build/src.linux-x86_64-3.10/numpy/core/src/multiarray/scalartypes.o.d" failed with exit status 1
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

on Ubuntu 22.04.1 LTS

zoj613 commented 1 year ago

Hi @Dingel321 , thanks for the error report. Which version of python are you trying to install this package on?

Dingel321 commented 1 year ago

Python 3.10.0

zoj613 commented 1 year ago

Python 3.10.0

Ahh, this is to be expected considering that pyhtnorm's build system hasn't been updated to accommodate later versions of python. It uses numpy 1.18.1 for building the package if pre-built wheels are not available on PyPI. However python 3.10 requires using numpy>=1.21.3 in the build stage to work. This requires a PR to update the build system for python 3.10 and 3.11 similarly to how it had been done here: https://github.com/zoj613/polyagamma/blob/5b0ab27e0bd8bd89e4fa011918cbd37aee527783/pyproject.toml#L51-L59

zoj613 commented 1 year ago

@Dingel321 you can now be able to install the package on python 3.11 using v2.0.1 from https://pypi.org/project/pyhtnorm/#files