试图安装pythonn包但遇到“找不到-lgcc_s”错误

时间:2018-01-01 01:43:05

标签: python gcc

您好我试图在Ubuntu 16.04下安装名为'pysptk'的python包,但是当我使用时:

pip install pysptk

我遇到了以下错误。

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

但是,我已经安装了gcc 4.8.5,因为'gcc -v'会产生输出。我的python版本是3.6.1,环境是Anaconda。我已经google了这个bug,但重新安装gcc和python3-dev不起作用。

代码

easy_install pysptk

将提供以下输出。

Searching for pysptk
Reading https://pypi.python.org/simple/pysptk/
Downloading https://pypi.python.org/packages/3d/86/5520242ab99426d8d9b2f18a86ed73f1be848b9fb14e57b2b81b8f17a1bb/pysptk-0.1.8.tar.gz#md5=d34133d2eaccba83f634310602721657
Best match: pysptk 0.1.8
Processing pysptk-0.1.8.tar.gz
Writing /tmp/easy_install-0xk7me9z/pysptk-0.1.8/setup.cfg
Running pysptk-0.1.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0xk7me9z/pysptk-0.1.8/egg-dist-tmp-wm2zkn7r
fatal: Not a git repository (or any of the parent directories): .git
-- Building version 0.1.8
In file included from /home/luke/anaconda3/lib/python3.6/site-
packages/numpy/core/include/numpy/ndarraytypes.h:1809:0,
             from /home/luke/anaconda3/lib/python3.6/site-
packages/numpy/core/include/numpy/ndarrayobject.h:18,
             from /home/luke/anaconda3/lib/python3.6/site-
packages/numpy/core/include/numpy/arrayobject.h:4,
             from pysptk/_sptk.c:436:
/home/luke/anaconda3/lib/python3.6/site-
packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: 
#warning "Using deprecated NumPy API, disable it by " "#defining 
NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
  ^
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
error: Setup script exited with error: command 'gcc' failed with exit status 1

有谁知道问题是什么?我真的很感谢你的帮助!如果有任何遗漏的信息。请告诉我。非常感谢。

1 个答案:

答案 0 :(得分:0)

首先,我不知道您是否应该使用pip在Anaconda上安装软件包。使用conda install来安装软件包。可能发生的情况是pip尝试在您计算机上的其他python上安装软件包,但是该Python没有安装“ gcc”。我在使用gcc命令从源代码安装Python之前遇到了这个问题。尝试pip -V来查看pip命令正在调用哪个Python。

我注意到的另一件事是您说您的Python是Python3.6.1,但是您没有使用pip3命令。我建议您尝试执行conda install pysptkpip3 install pysptk