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
Could you post the whole error log?
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
...... ... .... ...
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]
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│
It looks like you're missing a dependency. Try installing the blas library for your OS.
I installed blas with "conda install blas" within conda enviroment. But I am still getting same error .
Could you try it with the dev version of the package. It looks like this one: https://anaconda.org/conda-forge/blas-devel
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]
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 .