cell2location报错

安装链接如下:

Installation of pymc3 version with GPU support — cell2location documentation
使用下面这个方案安装到一半 开始报错

image.png
  Using cached scikit_misc-0.5.2.tar.gz (298 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'

Pip subprocess error:
  error: subprocess-exited-with-error

  × installing build dependencies for scikit-misc did not run successfully.
  │ exit code: 1
  ╰─> [52 lines of output]
      Collecting meson-python>=0.15.0
        Using cached meson_python-0.18.0-py3-none-any.whl.metadata (2.8 kB)
      Collecting Cython>=3.0.8
        Using cached cython-3.2.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_                                                                                                                                                         17_x86_64.manylinux_2_28_x86_64.whl.metadata (4.5 kB)
      Collecting setuptools
        Using cached setuptools-80.9.0-py3-none-any.whl.metadata (6.6 kB)
      Collecting wheel
        Using cached wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
      Collecting numpy>=2.0
        Using cached numpy-2.3.5.tar.gz (20.6 MB)
        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'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Preparing metadata (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [19 lines of output]
            + /cluster/home/gaoli/miniconda3/envs/cell2loc_env/bin/python /tmp/                                                                                                                                                         pip-install-8m0nlhgg/numpy_ea251ddb410a442e815574f4bea75f0a/vendored-meson/meso                                                                                                                                                         n/meson.py setup /tmp/pip-install-8m0nlhgg/numpy_ea251ddb410a442e815574f4bea75f                                                                                                                                                         0a /tmp/pip-install-8m0nlhgg/numpy_ea251ddb410a442e815574f4bea75f0a/.mesonpy-zg                                                                                                                                                         2o5yrx -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tm                                                                                                                                                         p/pip-install-8m0nlhgg/numpy_ea251ddb410a442e815574f4bea75f0a/.mesonpy-zg2o5yrx                                                                                                                                                         /meson-python-native-file.ini
            The Meson build system
            Version: 1.8.3
            Source dir: /tmp/pip-install-8m0nlhgg/numpy_ea251ddb410a442e815574f                                                                                                                                                         4bea75f0a
            Build dir: /tmp/pip-install-8m0nlhgg/numpy_ea251ddb410a442e815574f4                                                                                                                                                         bea75f0a/.mesonpy-zg2o5yrx
            Build type: native build
            Project name: NumPy
            Project version: 2.3.5
            C compiler for the host machine: cc (gcc 4.8.5 "cc (GCC) 4.8.5 2015                                                                                                                                                         0623 (Red Hat 4.8.5-39)")
            C linker for the host machine: cc ld.bfd 2.27-41
            C++ compiler for the host machine: c++ (gcc 4.8.5 "c++ (GCC) 4.8.5                                                                                                                                                          20150623 (Red Hat 4.8.5-39)")
            C++ linker for the host machine: c++ ld.bfd 2.27-41
            Cython compiler for the host machine: cython (cython 3.2.3)
            Host machine cpu family: x86_64
            Host machine cpu: x86_64

            ../meson.build:28:4: ERROR: Problem encountered: NumPy requires GCC                                                                                                                                                          >= 9.3

            A full log can be found at /tmp/pip-install-8m0nlhgg/numpy_ea251ddb                                                                                                                                                         410a442e815574f4bea75f0a/.mesonpy-zg2o5yrx/meson-logs/meson-log.txt
            [end of output]

        note: This error originates from a subprocess, and is likely not a prob                                                                                                                                                         lem with pip.
      error: metadata-generation-failed

      × Encountered error while generating package metadata.
      ╰─> numpy

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem wi                                                                                                                                                         th pip.
ERROR: Failed to build 'scikit-misc' when installing build dependencies for sci                                                                                                                                                         kit-misc
                                                                             fa                                                                                                                                                         iled

CondaEnvException: Pip failed

显示是gcc版本不够 导致的 numpy版本装不上

然后
which gcc /usr/bin/gccgcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

然后使用conda安装一个gcc 替换掉这个环境中gcc
使用了

conda install gcc_linux-64=9.* gxx_linux-64=9.*
然后成功安装

使用下面的代码去替换环境

export PATH="${path}/miniconda3/envs/cell2loc_env/bin:$PATH"

以及

export CC={path}/miniconda3/envs/cell2loc_env/bin/x86_64-conda-linux-gnu-gcc
export CXX={path}miniconda3/envs/cell2loc_env/bin/x86_64-conda-linux-gnu-g++

然后发现gcc还是刚才那个 就是没有用
所以检察一下环境中
ls ${path}/miniconda3/envs/cell2loc_env/bin/x86_64*
是下载好了的
是有x86_64-conda-linux-gnu-gcc的
但是没有直接的gcc

后面是进入到
~/miniconda3/envs/cell2loc_env/bin
这个文件夹中

ln -sf x86_64-conda-linux-gnu-gcc gcc
ln -sf x86_64-conda-linux-gnu-g++ g++
建立软连接后
然后which gcc就修改为使用conda环境下的了

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容