安装paramiko> pycrypto给出了编译错误

时间:2013-07-14 13:38:19

标签: paramiko

我不是C程序员。任何想法,这需要什么?

这是我尝试过的安装命令:

pip install paramiko
sudo pip install paramiko

输出:

src/_fastmath.c:1545:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]

                        else if (result < 0)

                                 ~~~~~~ ^ ~

src/_fastmath.c:1621:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]

                        else if (result < 0)

                                 ~~~~~~ ^ ~

2 warnings generated.

clang -bundle -undefined dynamic_lookup build/temp.macosx-10.8-x86_64-2.7/src/_fastmath.o -lgmp -o build/lib.macosx-10.8-x86_64-2.7/Crypto/PublicKey/_fastmath.so

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: command 'clang' failed with exit status 1

----------------------------------------

Command /Users/Ceti/.pythonbrew/pythons/Python-2.7.3/bin/python -c "import setuptools;__file__='/private/tmp/pip-build-root/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Rrbho6-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip-build-root/pycrypto

Exception information:
Traceback (most recent call last):
  File "/Users/Ceti/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/Users/Ceti/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/install.py", line 271, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/Users/Ceti/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1185, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/Users/Ceti/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 592, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/Users/Ceti/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 662, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command /Users/Ceti/.pythonbrew/pythons/Python-2.7.3/bin/python -c "import setuptools;__file__='/private/tmp/pip-build-root/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Rrbho6-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip-build-root/pycrypto

2 个答案:

答案 0 :(得分:7)

在CentOS / RHEL 6&#34; yum install python-devel&#34;将解决这个问题。 (您需要Python标头,因此可以安装pycrypto。)

答案 1 :(得分:4)

不知何故,这是一个谷歌的顶级结果,即使问题很糟糕,也没有提出任何解决方案。对于我的设置,我在debian 7和python 2.7上安装paramiko。

我通过安装python-dev:

为我自己解决了这个问题
aptitude install python-dev

我希望能帮助遇到此错误消息的其他任何人。