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

Read more

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

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

Read more

You Missed

AI很厉害,可你省的人力费还不够买Token!

  • u2
  • 6月 2, 2026
  • 33 views

RSI取代AGI成为新热词:AI能自我进化吗?

  • u2
  • 5月 30, 2026
  • 61 views

纳斯达克指数创历史新高–全球资本对科技产业未来的重新定价!

  • u2
  • 5月 29, 2026
  • 86 views

GPT-5 Pro 自证数学定理:AI 的”博士级”时刻到了吗?

  • u2
  • 5月 28, 2026
  • 67 views

那个”AI监听你手机”的谎言,终于被戳破了

  • u2
  • 5月 27, 2026
  • 57 views

AI发现漏洞的速度已超越人类修复能力——Project Glasswing开启网络安全新纪元

  • u2
  • 5月 24, 2026
  • 85 views