error in pipeline installation dependent on numpy version 1.18.5
0
0
Entering edit mode
23 months ago

Hello everyone

I am working on whole slide imaging data. For this, I am trying to install pipeline available at https://github.com/aetherAI/whole-slide-cnn. All dependency packages are listed in poetry.lock and pyproject.toml.

Approach 1)

For installation, Under conda enviroment, I am using python 3.9. I am running "poetry install" for the packages installation.

"Package operations: 44 installs, 3 updates, 0 removals

• Installing numpy (1.18.5): Installing...

" Error : " 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

"

Approach 2)

I also tried to install numpy (specific version 1.18.5) from pip with command pip install numpy==1.18.5 which gives me same error.

" 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 "

Approach 3)

As a third approach, I downloaded wheel file for its installation from .whl file which was downloaded from https://mirrors.aliyun.com/pypi/simple/numpy/ and does not work .

I am working under python 3.9.10 (required by pipeline > 3.9), pip 22.3.1 and poetry 1.3.1

I am struggling from many days. If anyone had encountered same problem in installation of numpy ==1.18.5 , please help me to fix it.

I would appreciate all the suggestions

Thanks in advance

cnn numpy imaging python • 3.6k views
ADD COMMENT
0
Entering edit mode

Could you post the whole error log?

ADD REPLY
0
Entering edit mode

I tried to post entire error log but due to character limits , I am posting some error lines for approach 1 ...

Installing dependencies from lock file

Package operations: 44 installs, 3 updates, 0 removals

• Installing numpy (1.18.5)

CalledProcessError

Command '['/home/user/.conda/envs/whole/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/home/user/.conda/envs/whole', '--no-deps', '/home/user/.cache/pypoetry/artifacts/81/1b/af/c0086d36792c25e4c2b8da18a80c1d462be878dd505571a513f5592c11/numpy-1.18.5.zip']' returned non-zero exit status 1.

at ~/.conda/envs/whole/lib/python3.9/subprocess.py:528 in run 524│ # We don't call process.wait() as .__exit__ does that for us. 525│ raise 526│ retcode = process.poll() 527│ if check and retcode: → 528│ raise CalledProcessError(retcode, process.args, 529│ output=stdout, stderr=stderr) 530│ return CompletedProcess(process.args, retcode, stdout, stderr) 531│ 532│

The following error occurred when trying to handle this error:

EnvCommandError

Command ['/home/user/.conda/envs/whole/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/home/user/.conda/envs/whole', '--no-deps', '/home/user/.cache/pypoetry/artifacts/81/1b/af/c0086d36792c25e4c2b8da18a80c1d462be878dd505571a513f5592c11/numpy-1.18.5.zip'] errored with the following return code 1, and output: Processing /home/user/.cache/pypoetry/artifacts/81/1b/af/c0086d36792c25e4c2b8da18a80c1d462be878dd505571a513f5592c11/numpy-1.18.5.zip Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: numpy Building wheel for numpy (pyproject.toml): started Building wheel for numpy (pyproject.toml): finished with status 'error' error: subprocess-exited-with-error

× Building wheel for numpy (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [601 lines of output]
    Running from numpy source directory.
    /tmp/pip-req-build-ii1anjl7/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      required_version = LooseVersion('0.29.14')
    /tmp/pip-req-build-ii1anjl7/tools/cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
      if LooseVersion(cython_version) < required_version:
    numpy/random/_bounded_integers.pxd.in has not changed
    numpy/random/_mt19937.pyx has not changed
    numpy/random/_generator.pyx has not changed
    numpy/random/_philox.pyx has not changed
    numpy/random/_bit_generator.pyx has not changed
    numpy/random/_bounded_integers.pyx.in has not changed
    numpy/random/_common.pyx has not changed
    numpy/random/_sfc64.pyx has not changed
    numpy/random/_pcg64.pyx has not changed
    numpy/random/mtrand.pyx has not changed
    Processing numpy/random/_bounded_integers.pyx
    Cythonizing sources
    blas_opt_info:
    blas_mkl_info:
    customize UnixCCompiler
      libraries mkl_rt not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    blis_info:
      libraries blis not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    openblas_info:
      libraries openblas not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64/sse2', '/usr/lib64', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_blas_info:
      libraries satlas not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64/sse2', '/usr/lib64', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64/sse2', '/usr/lib64', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64/sse2', '/usr/lib64', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    accelerate_info:
      NOT AVAILABLE

    /tmp/pip-req-build-ii1anjl7/numpy/distutils/system_info.py:1896: UserWarning:
        Optimized (vendor) Blas libraries are not found.
        Falls back to netlib Blas library which has worse performance.
        A better performance should be easily gained by switching
        Blas library.
      if self._calc_info(blas):
    blas_info:
      libraries blas not found in ['/home/user/.conda/envs/whole/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    /tmp/pip-req-build-ii1anjl7/numpy/distutils/system_info.py:1896: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      if self._calc_info(blas):
    blas_src_info:
      NOT AVAILABLE


    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries lapack_atlas not found in /home/user/.conda/envs/whole/lib
      libraries tatlas,tatlas not found in /home/user/.conda/envs/whole/lib
      libraries lapack_atlas not found in /usr/local/lib64
      libraries tatlas,tatlas not found in /usr/local/lib64
      libraries lapack_atlas not found in /usr/local/lib

...... ... .... ...

error: Command "gcc -pthread -B /home/user/.conda/envs/whole/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/user/.conda/envs/whole/include -fPIC -O2 -isystem /home/user/.conda/envs/whole/include -fPIC -Ibuild/src.linux-x86_64-3.9/numpy/core/src/common -Inumpy/core/include -Ibuild/src.linux-x86_64-3.9/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/user/.conda/envs/whole/include/python3.9 -Ibuild/src.linux-x86_64-3.9/numpy/core/src/common -Ibuild/src.linux-x86_64-3.9/numpy/core/src/npymath -c build/src.linux-x86_64-3.9/numpy/core/src/npysort/radixsort.c -o build/temp.linux-x86_64-cpython-39/build/src.linux-x86_64-3.9/numpy/core/src/npysort/radixsort.o -MMD -MF build/temp.linux-x86_64-cpython-39/build/src.linux-x86_64-3.9/numpy/core/src/npysort/radixsort.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

at ~/.conda/envs/whole/lib/python3.9/site-packages/poetry/utils/env.py:1540 in _run 1536│ output = subprocess.check_output( 1537│ command, stderr=subprocess.STDOUT, env=env, kwargs 1538│ ) 1539│ except CalledProcessError as e: → 1540│ raise EnvCommandError(e, input=input_) 1541│ 1542│ return decode(output) 1543│ 1544│ def execute(self, bin: str, *args: str, kwargs: Any) -> int:

The following error occurred when trying to handle this error:

PoetryException

Failed to install /home/user/.cache/pypoetry/artifacts/81/1b/af/c0086d36792c25e4c2b8da18a80c1d462be878dd505571a513f5592c11/numpy-1.18.5.zip

at ~/.conda/envs/whole/lib/python3.9/site-packages/poetry/utils/pip.py:58 in pip_install 54│ 55│ try: 56│ return environment.run_pip(*args) 57│ except EnvCommandError as e: → 58│ raise PoetryException(f"Failed to install {path.as_posix()}") from e 59│

ADD REPLY
0
Entering edit mode

It looks like you're missing a dependency. Try installing the blas library for your OS.

ADD REPLY
0
Entering edit mode

I installed blas with "conda install blas" within conda enviroment. But I am still getting same error .

ADD REPLY
1
Entering edit mode

Could you try it with the dev version of the package. It looks like this one: https://anaconda.org/conda-forge/blas-devel

ADD REPLY
0
Entering edit mode

I installed blas library and also had to define the CFLAGS for numpy as given below and it worked. I was struggling with this error from last two weeks. Thanks alot barslmn!!

CFLAGS=-std=c99 poetry install Installing dependencies from lock file

Package operations: 35 installs, 6 updates, 0 removals

• Updating importlib-metadata (4.11.4 -> 6.0.0)

• Updating numpy (1.18.0 -> 1.18.5)

• Updating h5py (3.7.0 -> 2.10.0): Failed

From poetry install, another package h5py installation failed.

From error log, it says Cython is missing but it is already installed via pip3.

File "/tmp/pip-req-build-al394xe3/setup_build.py", line 161, in run from Cython.Build import cythonize ModuleNotFoundError: No module named 'Cython' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for h5py

Failed to build h5py ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects

at ~/.conda/envs/whole2/lib/python3.9/site-packages/poetry/utils/env.py:1540 in _run 1536│ output = subprocess.check_output( 1537│ command, stderr=subprocess.STDOUT, env=env, kwargs 1538│ ) 1539│ except CalledProcessError as e: → 1540│ raise EnvCommandError(e, input=input_) 1541│ 1542│ return decode(output) 1543│ 1544│ def execute(self, bin: str, *args: str, kwargs: Any) -> int:

The following error occurred when trying to handle this error:

PoetryException

Failed to install /home/usr/.cache/pypoetry/artifacts/67/73/11/59cd898ab55f65d9213500215b00e663dafb02beb2e48301f1ffc078ae/h5py-2.10.0.tar.gz

This is first time I am working with pacakges installation with poetry (for pipeline installation).

I would appreciate all the suggestion .

ADD REPLY

Login before adding your answer.

Traffic: 2348 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6