前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >「踩坑实录」一个让我调试4小时的 dolomite-base 安装问题

「踩坑实录」一个让我调试4小时的 dolomite-base 安装问题

作者头像
用户11414625
发布2025-02-25 09:00:50
发布2025-02-25 09:00:50
6400
代码可运行
举报
文章被收录于专栏:生信星球520生信星球520
运行总次数:0
代码可运行

这个包是celldex的依赖项,而celldex则是singler的配套参考数据包。所以我们安装celldex就会自动安装他。

省流提示:解决问题最终成功的尝试是2.3,其他步骤不需要操作了。但可以从中学习一下都有啥可以干的,毕竟谁也没有上帝视角,不知道哪个尝试会有效嘛。

希望你看到这些报错和尝试不要害怕,产生畏难情绪,其实难度都在我这里,展示这个过程是为了做记录,学方法。以后有不是我教的内容,才会需要自己配置环境的,如果是我教的,我会负责

1.构建wheel非常慢,然后报错

Wheel 是 Python 的一种预编译包格式,文件扩展名为 .whl。它是 Python 打包机制的一个重要组成部分,可以看作是一个"ready-to-install"(即开即用)的包格式。

正常情况下pip install 会自动完成编译的工作,但这次遇到了报错。

代码语言:javascript
代码运行次数:0
复制
 error: command '/tmp/pip-build-env-upbakww0/overlay/bin/cmake' failed with exit code 2
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dolomite_base
Failed to build dolomite_base
ERROR: Failed to build installable wheels for some pyproject.toml based projects (dolomite_base)

估计是ubuntu缺什么零件。pip install -v 可以显示详细日志,便于排查问题,报错如下:

代码语言:javascript
代码运行次数:0
复制
  cmake -S lib -B build/temp.linux-x86_64-cpython-311 -Dpybind11_DIR=/tmp/pip-build-env-asv1jvd9/overlay/lib/python3.11/site-packages/pybind11/share/cmake/pybind11 -DPYTHON_EXECUTABLE=/home/bio02/miniconda3/envs/sc3/bin/python3.11 -DCMAKE_BUILD_TYPE=Release -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-8pmbmqc6/dolomite-base_ed6d850d5123490f96c1ae0aa089c8fa/build/lib.linux-x86_64-cpython-311/dolomite_base
  -- The CXX compiler identification is GNU 9.4.0
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
  -- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS C CXX)
  -- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS C CXX)



  [ 11%] Creating directories for 'chihaya-populate'
  [ 22%] Performing download step (git clone) for 'chihaya-populate'
  Cloning into 'chihaya-src'...
  fatal: unable to access 'https://github.com/ArtifactDB/chihaya/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
  Cloning into 'chihaya-src'...
  error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
  fatal: the remote end hung up unexpectedly
  Cloning into 'chihaya-src'...
  fatal: unable to access 'https://github.com/ArtifactDB/chihaya/': Failed to connect to github.com port 443: Connection timed out
  Had to git clone more than once: 3 times.
  CMake Error at chihaya-subbuild/chihaya-populate-prefix/tmp/chihaya-populate-gitclone.cmake:50 (message):
    Failed to clone repository: 'https://github.com/ArtifactDB/chihaya'


  make[2]: *** [CMakeFiles/chihaya-populate.dir/build.make:102: chihaya-populate-prefix/src/chihaya-populate-stamp/chihaya-populate-download] Error 1
  make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/chihaya-populate.dir/all] Error 2
  make: *** [Makefile:91: all] Error 2

  CMake Error at /tmp/pip-build-env-asv1jvd9/overlay/lib/python3.11/site-packages/cmake/data/share/cmake-3.31/Modules/FetchContent.cmake:1918 (message):
    Build step for chihaya failed: 2
  Call Stack (most recent call first):
    /tmp/pip-build-env-asv1jvd9/overlay/lib/python3.11/site-packages/cmake/data/share/cmake-3.31/Modules/FetchContent.cmake:1609 (__FetchContent_populateSubbuild)
    /tmp/pip-build-env-asv1jvd9/overlay/lib/python3.11/site-packages/cmake/data/share/cmake-3.31/Modules/FetchContent.cmake:2145:EVAL:2 (__FetchContent_doPopulation)
    /tmp/pip-build-env-asv1jvd9/overlay/lib/python3.11/site-packages/cmake/data/share/cmake-3.31/Modules/FetchContent.cmake:2145 (cmake_language)
    /tmp/pip-build-env-asv1jvd9/overlay/lib/python3.11/site-packages/cmake/data/share/cmake-3.31/Modules/FetchContent.cmake:2384 (__FetchContent_Populate)
    /tmp/pip-install-8pmbmqc6/dolomite-base_ed6d850d5123490f96c1ae0aa089c8fa/build/temp.linux-x86_64-cpython-311/_deps/takane-src/extern/CMakeLists.txt:23 (FetchContent_MakeAvailable)


  -- Configuring incomplete, errors occurred!


  An error occurred while building the project, please ensure you have the most updated version of setuptools, setuptools_scm and wheel with:
     pip install -U setuptools setuptools_scm wheel


  error: command '/tmp/pip-build-env-asv1jvd9/overlay/bin/cmake' failed with exit code 1
  error: subprocess-exited-with-error

  × Building wheel for dolomite_base (pyproject.toml) 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.
  full command: /home/bio02/miniconda3/envs/sc3/bin/python3.11 /home/bio02/miniconda3/envs/sc3/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmplhya7b20
  cwd: /tmp/pip-install-8pmbmqc6/dolomite-base_ed6d850d5123490f96c1ae0aa089c8fa
  Building wheel for dolomite_base (pyproject.toml) ... error
  ERROR: Failed building wheel for dolomite_base
Failed to build dolomite_base
ERROR: Failed to build installable wheels for some pyproject.toml based projects (dolomite_base)

其实两大段的关键词都是ERROR: Failed building wheel for dolomite_base,编译失败!

2.最终成功的尝试:下载whl,修改后装它

pip页面会提供预编译版本的whl文件,直接使用即可跳过编译的步骤

文件名中包括了python版本和设备的平台。其中ubuntu适用的是manyliux,适用mac的是macos。

遇到3个问题:

1.报错说whl文件不适用当前平台
代码语言:javascript
代码运行次数:0
复制
 dolomite_base-0.4.2-cp311-cp311-manylinux_1_2_x86_64.whl is not a supported wheel on this platform.ubuntu

解决办法:下载manylinux版本,改文件名,去掉平台名字,加上none-any即可安装!

改名字,真是一个看起来不咋地但有效的行为!

https://blog.csdn.net/yuangan1529/article/details/116696624

改为: dolomite_base-0.4.2-cp311-none-any.whl就可以安装了

2.python3.11对应的最新版本的wheel文件,编译软件与我电脑上的版本不相同

conda list能列出来了,但是import报错!

说编译时使用的glibc版本为2.32,但我的ubuntu最多只能更新到2.31,要求二者一致,因此能安装但import就会报错

代码语言:javascript
代码运行次数:0
复制
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/dolomite_base/lib_dolomite_base.cpython-311-x86_64-linux-gnu.so)

检查glibc版本的办法是:

代码语言:javascript
代码运行次数:0
复制
ldd --version

试图更新glibc,发现最新只能到2.31

代码语言:javascript
代码运行次数:0
复制
sudo apt-get install libc6-dev
代码语言:javascript
代码运行次数:0
复制
eading package lists... Done
Building dependency tree
Reading state information... Done
libc6-dev is already the newest version (2.31-0ubuntu9.17).
libc6-dev set to manually installed.
The following packages were automatically installed and are no longer required:
  libfwupdplugin1 libxmlb1
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

给我整愣住了。不能升级自己电脑上的glibc,那我使用whl的上一个版本吧。

3.安装python3.10对应的whl文件,报错循环导入
代码语言:javascript
代码运行次数:0
复制
 python -c 'import dolomite_base'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/dolomite_base/__init__.py", line 18, in <module>
    from .save_object import save_object, validate_saves
  File "/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/dolomite_base/save_object.py", line 3, in <module>
    from .validate_object import validate_object
  File "/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/dolomite_base/validate_object.py", line 3, in <module>
    from . import lib_dolomite_base as lib
ImportError: cannot import name 'lib_dolomite_base' from partially initialized module 'dolomite_base' (most likely due to a circular import) (/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/dolomite_base/__init__.py)

原本想去改miniconda库里的文件,但报错没有权限修改,如果要改其实也可以,就是先chord设置一下权限再改。

但我选择了更安全的方式--whl本质是zip压缩包,所以用7-zip解压,改完代码然后重新压缩,选择压缩类型为zip,命名时后缀写whl,即可正常安装和使用。

按照ai提示修改了两处源代码,解决了其循环导入的问题。

代码语言:javascript
代码运行次数:0
复制
通过网盘分享的文件:dolomite_base-0.4.2-cp311-none-any.whl
链接: https://pan.baidu.com/s/1Asaveg9mP1xz9IroZTJDSA?pwd=883m 提取码: 883m 
--来自百度网盘超级会员v5的分享

下载此文件放在工作目录下

代码语言:javascript
代码运行次数:0
复制
conda activate sc2
pip install dolomite_base-0.4.2-cp311-none-any.whl

然后再继续装celldex等,就没有问题了。

3.最终石沉大海的其他尝试

还有各种无用尝试,花了三四个小时。真是个难缠的bug

3.1 退一个版本,安装旧版本的dolomite_base和celldex

但发现,即使已经有了dolomite旧版本,celldex安装时还是会更新他,因为celldex没有指定要求什么版本的dolomite_base,就默认安装最新版!

解决办法是把这两个包的版本都指定好再安装。

代码语言:javascript
代码运行次数:0
复制
pip install celldex==0.1.1 dolomite_base==0.4.0

但又有新问题,dolomite_base有好几个同系列的包,全体依赖最新版的dolomite_base!所以要退大家一起退吧!

尝试发现,一起退也不行,指定的太多了,其他的包无法解决环境冲突了!我去,流氓软件全家桶!

冲突的表现是有报错,而且运行jupyternotebook里原本调好了的代码会:

代码语言:javascript
代码运行次数:0
复制
 cannot import name 'TatamiNumericPointer' from 'mattress' (/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/mattress/__init__.py)
3.2 试图解决编译环境的问题

跟着ai的提示去装和更新各种编译工具

企图用源码方式装新版的GLIBC2.32,那一大堆报错,我都不知道该咋问,中途放弃。

cmake版本更新成功,但报错信息无任何变化,说明更新了没有用

代码语言:javascript
代码运行次数:0
复制
sudo apt-get update
sudo apt-get install -y software-properties-common lsb-release wget
sudo apt-get remove --purge cmake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | sudo apt-key add -
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
sudo apt-get update
sudo apt-get install cmake

gcc 和g++更新,也没有用

代码语言:javascript
代码运行次数:0
复制
sudo apt-get update
sudo apt-get install -y gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 100

3.3 试图安装github的版本

方法是从github页面上下载zip,然后解压并cd进去,pip .即可,但是遇到新的问题

说是setuptools-scm无法自动检测版本。AI 提示修改源码,越改问题越多,遂放弃。

代码语言:javascript
代码运行次数:0
复制
 pip install .
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple/
Processing /mnt/c/Users/win10/Desktop/python250208/day7.8/dolomite-base-master
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [46 lines of output]


      An error occurred while building the project, please ensure you have the most updated version of setuptools, setuptools_scm and wheel with:
         pip install -U setuptools setuptools_scm wheel


      Traceback (most recent call last):
        File "/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/bio02/miniconda3/envs/sc2/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 62, in <module>
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 148, in setup
          _setup_distribution = dist = klass(attrs)
                                       ^^^^^^^^^^^^
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 319, in __init__
          _Distribution.__init__(self, dist_attrs)
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 290, in __init__
          self.finalize_options()
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 681, in finalize_options
          ep(self)
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools_scm/_integration/setuptools.py", line 123, in infer_version
          _assign_version(dist, config)
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools_scm/_integration/setuptools.py", line 58, in _assign_version
          _version_missing(config)
        File "/tmp/pip-build-env-3tljex4b/overlay/lib/python3.11/site-packages/setuptools_scm/_get_version_impl.py", line 117, in _version_missing
          raise LookupError(
      LookupError: setuptools-scm was unable to detect version for /mnt/c/Users/win10/Desktop/python250208/day7.8/dolomite-base-master.

      Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

      For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
      [end of output]

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

× Getting requirements to build wheel 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.
3.4 h5df 找不到的问题
代码语言:javascript
代码运行次数:0
复制
  -- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS C CXX)
  -- Could NOT find HDF5 (missing: HDF5_LIBRARIES HDF5_INCLUDE_DIRS C CXX)

查看电脑上是否有hdf5及其开发头文件

代码语言:javascript
代码运行次数:0
复制
dpkg -l | grep hdf5

如果已经安装了 HDF5 和开发包,应该能看到类似以下输出:

代码语言:javascript
代码运行次数:0
复制
ii  libhdf5-103:amd64        1.10.4+repack-10ubuntu1        amd64        Hierarchical Data Format 5 (HDF5) - runtime files
ii  libhdf5-dev              1.10.4+repack-10ubuntu1        amd64        Hierarchical Data Format 5 (HDF5) - development files

如果未安装,就不会输出任何内容。可以通过以下命令安装:

代码语言:javascript
代码运行次数:0
复制
sudo apt-get install libhdf5-dev
3.5 github克隆失败的问题
代码语言:javascript
代码运行次数:0
复制
[ 11%] Creating directories for 'chihaya-populate'
  [ 22%] Performing download step (git clone) for 'chihaya-populate'
  Cloning into 'chihaya-src'...
  fatal: unable to access 'https://github.com/ArtifactDB/chihaya/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
  Cloning into 'chihaya-src'...
  error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properly terminated.
  fatal: the remote end hung up unexpectedly
  Cloning into 'chihaya-src'...
  fatal: unable to access 'https://github.com/ArtifactDB/chihaya/': Failed to connect to github.com port 443: Connection timed out
  Had to git clone more than once: 3 times.
  CMake Error at chihaya-subbuild/chihaya-populate-prefix/tmp/chihaya-populate-gitclone.cmake:50 (message):
    Failed to clone repository: 'https://github.com/ArtifactDB/chihaya'

报错信息显示,CMake 使用 FetchContent 模块从 GitHub 克隆依赖库 chihaya 时失败,具体错误如下:

● TLS 连接未正确终止 (GnuTLS recv error (-110) 或 curl 56 GnuTLS recv error (-110))。

● 连接超时 (Failed to connect to github.com port 443: Connection timed out)。

这通常与网络连接或 Git 配置有关。

  1. 使用浏览器直接下载 ZIP 文件** GitHub 提供了直接下载仓库的功能,无需使用 git clone
  2. 打开目标仓库的 GitHub 页面,例如: https://github.com/ArtifactDB/chihaya
  3. 点击页面右上角的绿色按钮 “Code”
  4. 选择 “Download ZIP”,下载完整的仓库代码。
  5. 解压 ZIP 文件后,将代码放置到项目需要的位置。
  6. 在解压后的文件夹里创建一个build文件夹
代码语言:javascript
代码运行次数:0
复制
cmake ..
cmake --build .

但。。。说了石沉大海嘛。没有效果。

4.换台电脑,问题直接消失!

啊呦我去。。。就啥事没有啊!那就用八字不合来解释吧。

5.我看这个包挺不吉利的

https://www.piwheels.org/project/dolomite-base/

上面显示全部编译失败

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2025-02-21,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 生信星球 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1.构建wheel非常慢,然后报错
  • 2.最终成功的尝试:下载whl,修改后装它
    • 1.报错说whl文件不适用当前平台
    • 2.python3.11对应的最新版本的wheel文件,编译软件与我电脑上的版本不相同
    • 3.安装python3.10对应的whl文件,报错循环导入
  • 3.最终石沉大海的其他尝试
    • 3.1 退一个版本,安装旧版本的dolomite_base和celldex
    • 3.2 试图解决编译环境的问题
    • 3.3 试图安装github的版本
    • 3.4 h5df 找不到的问题
    • 3.5 github克隆失败的问题
  • 4.换台电脑,问题直接消失!
  • 5.我看这个包挺不吉利的
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档