【问题标题】:Unable to install REBOUND in Python with pip无法使用 pip 在 Python 中安装 REBOUND
【发布时间】:2019-04-18 11:57:46
【问题描述】:

我想在我新的 Fedora 29 中安装 Python 2.7 和 Python 3.7 的 REBOUND 库。

我试过了:

python -m pip install --user rebound

这确实找到了包(我也尝试了使用 dnf 和 yum 的几种参数组合,但那些无法找到包)但是轮子失败并且 gcc 也失败了。我不知道该怎么做。我已经安装了几个包没有任何问题(numpymatplotlibscipykeras 等),但是对于 REBOUND,事情会以某种方式出错。

这是我得到的错误:

   /usr/bin/ld: cannot find -lpython2.7
   collect2: error: ld returned 1 exit status
   error: command 'gcc' failed with exit status 1

   ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-
install-zOfeCV/rebound/setup.py';f=getattr(tokenize, 'open', 
open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, 
__file__, 'exec'))" install --record /tmp/pip-record-KVSdkl/install-record.txt 
--single-version-externally-managed --compile --user --prefix=" failed with error 
code 1 in /tmp/pip-install-zOfeCV/rebound/

由于日志很长,我已将完整日志放入粘贴箱。 (Pastebin)

【问题讨论】:

    标签: python gcc pip installation


    【解决方案1】:

    你有libpython2.7吗?试试locate -b libpython2.7。在我的 Debian 上有 /usr/lib/i386-linux-gnu/libpython2.7.a/usr/lib/i386-linux-gnu/libpython2.7.so。如果他们不在那里安装库

    sudo yum install python-devel
    

    【讨论】:

    • 成功了!我找到了两者,但在sudo dnf install python-devel 之后,我终于可以安装反弹了。谢谢先生。
    猜你喜欢
    • 2021-01-29
    • 1970-01-01
    • 2022-07-30
    • 2021-10-27
    • 1970-01-01
    • 2021-08-24
    • 1970-01-01
    • 2013-09-05
    • 2020-06-29
    相关资源
    最近更新 更多