在Mac OS X上,由于链接器错误“非法文本重定位”,easy_install结构和/或easy_install pycrypto失败

发布于 2021-01-29 17:24:34

尝试easy_installfabric(或easy_installpycrypto,取决于哪种结构)时,在Mac
OS X上出现以下链接器错误:

ld: illegal text-relocation to ___gmp_binvert_limb_table in /usr/local/lib/libgmp.a(mp_minv_tab.o) from ___gmpn_divexact_1 in /usr/local/lib/libgmp.a(dive_1.o) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Setup script exited with error: command 'clang' failed with exit status 1
关注者
0
被浏览
45
1 个回答
  • 面试哥
    面试哥 2021-01-29
    为面试而生,有面试问题,就找面试哥。

    我使用的是python的自定义安装,这显然与我的标准安装libGMP不兼容。从源代码构建libGMP(在我自己的前缀位置,由我的特殊python安装使用)解决了该问题。

    $ bunzip2 gmp-5.0.5.tar.bz2
    $ tar -xf gmp-5.0.5.tar
    $ cd gmp-5.0.5
    $ ./configure --prefix=/path/to/my/special/prefix
    $ make
    $ make check
    $ make install
    $ easy_install pycrypto
    $ easy_install fabric
    


知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看