mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.68k stars 346 forks source link

Failing to install pip package due problem with gcc and wheel #3226

Open jonasmac16 opened 5 months ago

jonasmac16 commented 5 months ago

Troubleshooting docs

Anaconda default channels

How did you install Mamba?

Micromamba

Search tried in issue tracker

gcc fail

Latest version of Mamba

Tried in Conda?

I didn't try

Describe your issue

I am using the micromamba docker container as the base for my apptainer container. I am currently running apptainer shell --writable path/to/container_folder. I can install most packages via micromamba but I have to resort for a few packages to pip. When I tried to install deepcell via pip (pip install deepcell=0.12.9 ) I get the following error (I have installed other packages via pip in this container and it worked fine):

...
Building wheels for collected packages: deepcell-toolbox
  Building wheel for deepcell-toolbox (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for deepcell-toolbox (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/__init__.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/__version__.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/deep_watershed.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/deep_watershed_test.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/metrics.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/metrics_test.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/processing.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/processing_test.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/utils.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      copying deepcell_toolbox/utils_test.py -> build/lib.linux-x86_64-cpython-310/deepcell_toolbox
      running build_ext
      cythoning deepcell_toolbox/compute_overlap.pyx to deepcell_toolbox/compute_overlap.c
      /tmp/pip-build-env-nflq0qjg/overlay/lib/python3.10/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /tmp/pip-install-f89abi0x/deepcell-toolbox_eee648a1ee14468786b66dfe4973456a/deepcell_toolbox/compute_overlap.pyx
        tree = Parsing.p_module(s, pxd, full_module_name)
      building 'deepcell_toolbox.compute_overlap' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/deepcell_toolbox
      gcc -pthread -B /opt/conda/envs/py310/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/conda/envs/py310/include -fPIC -O2 -isystem /opt/conda/envs/py310/include -fPIC -I/opt/conda/envs/py310/include/python3.10 -I/tmp/pip-build-env-nflq0qjg/overlay/lib/python3.10/site-packages/numpy/core/include -c deepcell_toolbox/compute_overlap.c -o build/temp.linux-x86_64-cpython-310/deepcell_toolbox/compute_overlap.o
      error: command 'gcc' failed: No such file or directory
      [end of output]

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

mamba info / micromamba info

libmamba version : 1.5.7
     micromamba version : 1.5.7
           curl version : libcurl/8.5.0 OpenSSL/3.2.1 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
     libarchive version : libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5
       envs directories : /opt/conda/envs
          package cache : /opt/conda/pkgs
                          /home/jonas/.mamba/pkgs
            environment : py310 (active)
           env location : /opt/conda/envs/py310
      user config files : /home/jonas/.mambarc
 populated config files : /home/jonas/.condarc
       virtual packages : __unix=0=0
                          __linux=6.7.8=0
                          __glibc=2.31=0
                          __archspec=1=x86_64-v3
               channels : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
       base environment : /opt/conda
               platform : linux-64

Logs

No response

environment.yml

No response

~/.condarc

No response

SymphonySimper commented 4 months ago

Yep, I do face the same issue but with a different package. Any solution?

SymphonySimper commented 4 months ago

Found a solution. Installing gcc via micromamba fixed the issue.

micromamba install -c conda-forge gcc_linux-64 gxx_linux-64
jonasmac16 commented 4 months ago

Same, that is what solved it for me including gcc in the environment yaml file.