最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python3中No module named _ssl的問題解決

 更新時間:2024年08月22日 09:25:30   作者:大小瓶  
本文主要介紹了python3中No module named _ssl的問題解決,這個錯誤表示Python導(dǎo)入_ssl模塊時失敗,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧

一、原因

因openssl 1.0.1存在安全問題,python3自3.7版本后要求依賴openssl 1.0.2以上或libressl;錯誤提示如下:Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_P

python3.7以上建議使用libressl代替openssl,故需通過源碼編譯安裝libressl

二、解決

# 下載源碼包
wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.0.2.tar.gz

# 解壓
tar -zxvf libressl-3.0.2.tar.gz
cd libressl-3.0.2

# 配置安裝路徑
mkdir /usr/local/libressl
./configure --prefix=/usr/local/libressl

# 安裝
make -j8
make install

# 創(chuàng)建軟連接代替openssl
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak

ln -s /usr/local/libressl/bin/openssl /usr/bin/openssl
ln -s /usr/local/libressl/include/openssl /usr/include/openssl
echo /usr/local/libressl/lib >> /etc/ld.so.conf.d/libressl-3.0.2.conf
ldconfig -v

驗證是否安裝完成

openssl version

設(shè)置環(huán)境變量

export LDFLAGS="-L/usr/local/libressl/lib"
export CPPFLAGS="-I/usr/local/libressl/include"
export PKG_CONFIG_PATH="/usr/local/libressl/lib/pkgconfig"

配置編譯安裝python

./configure --prefix=/usr/local/python37 
make
make install

驗證ssl 安裝正確
import ssl沒有報錯

到此這篇關(guān)于python3中No module named _ssl的問題解決的文章就介紹到這了,更多相關(guān)python3 No module named _ssl內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家! 

相關(guān)文章

最新評論

手游| 普定县| 莲花县| 桦南县| 县级市| 司法| 林西县| 田阳县| 牟定县| 赤壁市| 沅陵县| 黔西县| 全州县| 罗田县| 疏勒县| 南部县| 大田县| 恩施市| 威宁| 司法| 乌拉特前旗| 洛浦县| 抚顺县| 绩溪县| 西乌| 湘潭市| 胶州市| 淳安县| 无棣县| 吉林省| 南漳县| 北碚区| 临桂县| 古丈县| 阜阳市| 濮阳市| 建德市| 库伦旗| 泽库县| 天津市| 循化|