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

python3中No module named _ssl的問題解決

 更新時間:2024年08月22日 09:25:30   作者:大小瓶  
本文主要介紹了python3中No module named _ssl的問題解決,這個錯誤表示Python導入_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)文章

最新評論

榆树市| 延安市| 新绛县| 利川市| 太康县| 枞阳县| 疏附县| 湘潭县| 若羌县| 务川| 宁河县| 七台河市| 中超| 河间市| 利川市| 汶上县| 财经| 咸丰县| 远安县| 阜新市| 汝阳县| 平舆县| 南皮县| 山丹县| 文化| 班玛县| 浑源县| 交城县| 清水河县| 德清县| 临漳县| 西乡县| 柳州市| 宣汉县| 井冈山市| 天全县| 宜阳县| 五常市| 湟中县| 城固县| 绥化市|