RHEL 上的 Pycrypto 失败

Pycrypto on RHEL Fails

我正在尝试通过 pip 安装 pycrypto。安装失败:

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zWtfwz/pycrypto/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-OrjLDy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-zWtfwz/pycrypto/

我发现其他帖子说我需要通过 yum 下载 pycrypto,但是,引用的包似乎不再存在 - 至少不是那个名称。

我找到了我的问题的答案,供将来可能找到此问题的任何人使用。

在日志的更上方,我注意到:

configure: error: no acceptable C compiler found in $PATH

https://www.thelinuxfaq.com/74-error-no-acceptable-c-compiler-found-in-path-linux

我执行了:

yum groupinstall "Development tools"

然后

pip install pycrypto

按预期工作。

Collecting pycrypto Using cached pycrypto-2.6.1.tar.gz Building wheels for collected packages: pycrypto Running setup.py bdist_wheel for pycrypto ... done Stored in directory: /root/.cache/pip/wheels/80/1f/94/f76e9746864f198eb0e304aeec319159fa41b082f61281ffce Successfully built pycrypto Installing collected packages: pycrypto Successfully installed pycrypto-2.6.1

yum install gcc*

然后运行

pip install pycrypto