命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

新手上路,请多包涵

我试图安装“学术”包,但我一直收到这个错误:

 x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
build/temp.linux-x86_64-2.7/_openssl.c:434:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Command "/usr/bin/python -u -c "import setuptools,tokenize;__file__='/tmp/pip-build-0OXGEx/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EdgZGB-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-0OXGEx/cryptography/

已经尝试了以下帖子中的解决方案,但没有奏效:

pip安装lxml错误

原文由 msmazh 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 730
2 个回答

我有同样的问题。这个帮助了我:

 sudo apt-get install build-essential libssl-dev libffi-dev python-dev

如果您正在使用 python3 ,请尝试将 python-dev 替换为 python3-dev

原文由 Dana Spitzer Friedlander 发布,翻译遵循 CC BY-SA 4.0 许可协议

安装 lib32ncurses5-dev:

 sudo apt-get install lib32ncurses5-dev

原文由 Rastin 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题