pip 安装错误:命令“/usr/bin/gcc”失败,退出代码为 1 后

问题描述 投票:0回答:1

我正在尝试在 Ubuntu 22.04 机器上安装一个名为 job_stream 的 python 包 https://wwoods.github.io/job_stream/#installation。 我安装了 minidconda3,然后使用 virtualenv 中的“conda install boost”安装了 boost。我正在尝试执行下一步“pip install job_stream”,但是,我收到错误

"command '/usr/bin/gcc' failed with exit code 1
以下是我收到的全部消息

Building wheels for collected packages: job_stream
  Building wheel for job_stream (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [21 lines of output]
      boost-mpi-1.61/src/environment.cpp: In constructor ‘boost::mpi::environment::environment(bool)’:
      boost-mpi-1.61/src/environment.cpp:74:3: error: ‘MPI_Errhandler_set’ was not declared in this scope; did you mean ‘MPI_Errhandler_free’?
         74 |   MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
            |   ^~~~~~~~~~~~~~~~~~
            |   MPI_Errhandler_free
      boost-mpi-1.61/src/environment.cpp: In constructor ‘boost::mpi::environment::environment(boost::mpi::threading::level, bool)’:
      boost-mpi-1.61/src/environment.cpp:89:3: error: ‘MPI_Errhandler_set’ was not declared in this scope; did you mean ‘MPI_Errhandler_free’?
         89 |   MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
            |   ^~~~~~~~~~~~~~~~~~
            |   MPI_Errhandler_free
      boost-mpi-1.61/src/environment.cpp: In constructor ‘boost::mpi::environment::environment(int&, char**&, bool)’:
      boost-mpi-1.61/src/environment.cpp:102:3: error: ‘MPI_Errhandler_set’ was not declared in this scope; did you mean ‘MPI_Errhandler_free’?
        102 |   MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
            |   ^~~~~~~~~~~~~~~~~~
            |   MPI_Errhandler_free
      boost-mpi-1.61/src/environment.cpp: In constructor ‘boost::mpi::environment::environment(int&, char**&, boost::mpi::threading::level, bool)’:
      boost-mpi-1.61/src/environment.cpp:118:3: error: ‘MPI_Errhandler_set’ was not declared in this scope; did you mean ‘MPI_Errhandler_free’?
        118 |   MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
            |   ^~~~~~~~~~~~~~~~~~
            |   MPI_Errhandler_free
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for job_stream
  Running setup.py clean for job_stream
Failed to build job_stream
ERROR: Could not build wheels for job_stream, which is required to install pyproject.toml-based projects

有人知道我为什么会遇到这个问题以及如何解决吗?

我尝试在我的

.bashrc

中添加lib路径
export CPLUS_INCLUDE_PATH=$HOME/miniconda3/include/boost/
export LD_LIBRARY_PATH=$HOME/miniconda3/include/boost/

我也尝试过

conda install -y gcc

但是失败了

PackagesNotFoundError

但仍然遇到同样的错误。有什么建议吗?

python python-3.x boost pip miniconda
1个回答
0
投票

你安装了python3-dev吗?

如果您使用 Ubuntu 22.04,它应该运行 Python 3.10。因此要安装 python3-dev 你需要运行

sudo apt install python3.10-dev

© www.soinside.com 2019 - 2024. All rights reserved.