如何修复pip安装产生的gcc错误? [英] How to fix gcc error produced by pip install?

查看:202
本文介绍了如何修复pip安装产生的gcc错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下命令从PyPI安装python软件包

I tried to install a python package from PyPI with the following command

sudo pip3 install switcheo

安装失败,并显示以下错误消息:

The installation fails and show this error message:

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DHAVE_CONFIG_H -DHAVE_SYSCTL_HW_USERMEM=1 -Iscrypt-1.2.1 -Iscrypt-1.2.1/lib -Iscrypt-1.2.1/lib/scryptenc -Iscrypt-1.2.1/lib/crypto -Iscrypt-1.2.1/lib/util -Iscrypt-1.2.1/libcperciva/cpusupport -Iscrypt-1.2.1/libcperciva/alg -Iscrypt-1.2.1/libcperciva/util -Iscrypt-1.2.1/libcperciva/crypto -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c scrypt-1.2.1/libcperciva/util/asprintf.c -o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/asprintf.o
gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.7/src/scrypt.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix_sse2.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/crypto/crypto_scrypt_smix.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/crypto/crypto_scrypt.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/scryptenc/scryptenc.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/scryptenc/scryptenc_cpuperf.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/lib/util/memlimit.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/alg/sha256.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes_aesni.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_aes.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_aesctr.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/crypto/crypto_entropy.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/entropy.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/insecure_memzero.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/warnp.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/humansize.o build/temp.macosx-10.9-x86_64-3.7/scrypt-1.2.1/libcperciva/util/asprintf.o -lcrypto -o build/lib.macosx-10.9-x86_64-3.7/_scrypt.cpython-37m-darwin.so
ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-2cof4cvu/scrypt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/tmp/pip-record-1ecvxjh1/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-install-2cof4cvu/scrypt/

推荐答案

安装libssl-dev软件包

在Ubuntu上,就像sudo apt-get install libssl-dev

On Ubuntu, it's as simple as sudo apt-get install libssl-dev

在Mac上,您需要安装openssl:brew install openssl

On mac, you need to install openssl: brew install openssl

如果这不起作用,则需要安装Homebrew.您应该使用Homebrew,它使安装更加容易.

If that doesn't work, you need to install Homebrew. You should use Homebrew, it makes installing much easier.

如果仍然不起作用,则可以安装libssl-dev并建立符号链接:

If that still doesn't work, you can install libssl-dev and make a symlink:

ln -s /usr/local/Cellar/openssl/1.0.2p/lib/libssl.dylib /usr/local/lib/

这篇关于如何修复pip安装产生的gcc错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆