美文网首页
ssl module in Python is not avai

ssl module in Python is not avai

作者: 杨高路老司机 | 来源:发表于2016-12-22 00:22 被阅读0次

最近公司升级了Security Code,导致在内网机器上学习和开发个人项目变得很麻烦。我决定用VirtualBox安装Ubuntu虚拟机作为个人项目的开发环境。安装Python和pip时遇到了以下麻烦:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

这是由于Ubuntu默认安装时没有包括SSL相关的Library。解决方式如下

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

然后重新编译Python,即可以解决安装和使用pip时找不到SSL模块的问题。
除了libssl以外Ubuntu默认安装时还会缺失一些其他的库,建议在编译Python前将它们预先安装好,避免将来遇到错误后不得不重新编译。

sudo apt-get install libxml2-dev
sudo apt-get install libxslt-dev
sudo apt-get install libmysqlclient-dev
sudo apt-get install libsqlite3-dev
sudo apt-get install zlib1g-dev

暂时只能想到这么多,缺的以后再补上。

相关文章

网友评论

      本文标题:ssl module in Python is not avai

      本文链接:https://www.haomeiwen.com/subject/edjcvttx.html