Ubuntu-16.04下pip安装module时两个报错的解决

【摘要】操作系统:Ubuntu-16.04,pip安装module时两个报错:Cryptography_HAS_SSL_ST,openssl/opensslv.h: No such file的解决。

错误一提示:
File “build/bdist.linux-x86_64/egg/OpenSSL/__init__.py”, line 8, in
File “build/bdist.linux-x86_64/egg/OpenSSL/SSL.py”, line 194, in
AttributeError: ‘module’ object has no attribute ‘Cryptography_HAS_SSL_ST’

错误二提示:
creating /tmp/easy_install-EXVhCS/cryptography-2.4.2/.eggs/pycparser-2.19-py2.7.egg
Extracting pycparser-2.19-py2.7.egg to /tmp/easy_install-EXVhCS/cryptography-2.4.2/.eggs

Installed /tmp/easy_install-EXVhCS/cryptography-2.4.2/.eggs/pycparser-2.19-py2.7.egg
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘python_requires’
warnings.warn(msg)
no previously-included directories found matching ‘docs/_build’
warning: no previously-included files matching ‘*’ found under directory ‘vectors’
build/temp.linux-x86_64-2.7/_openssl.c:498:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1

还是缺少系统依赖导致,需要安装如下包:
apt-get install libffi-dev
apt-get install libssl-dev

python -m easy_install –upgrade pyOpenSSL
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pymysql

u2

Related Posts

rancher v2.x 初体验

rancher v2x

sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached

Python3 + Flask + mysql5.7搭建的w…

You Missed

雇佣AI员工,花钱上班:开发者的新”职场”荒诞剧

  • u2
  • 3月 1, 2026
  • 29 views
雇佣AI员工,花钱上班:开发者的新”职场”荒诞剧

OpenClaw 完整使用指南:自托管 AI Agent 的架构与实战

  • u2
  • 2月 25, 2026
  • 123 views
OpenClaw 完整使用指南:自托管 AI Agent 的架构与实战

Anthropic 推出 Claude Code Security:AI 驱动的代码安全神器

  • u2
  • 2月 24, 2026
  • 71 views

来自 OWASP 的代码安全检查工具:Dependency-Check,为你消除安全隐患

  • u2
  • 10月 16, 2025
  • 46 views
来自 OWASP 的代码安全检查工具:Dependency-Check,为你消除安全隐患

技术宅如何躲开越来越垃圾的CSDN?

  • u2
  • 4月 11, 2024
  • 33 views
技术宅如何躲开越来越垃圾的CSDN?

mysql连接失败:The driver has not received any packets from the server

  • u2
  • 3月 26, 2024
  • 35 views
mysql连接失败:The driver has not received any packets from the server