執(zhí)行poetry --version后象踊,提示
```
python urllib3 v2.0 only supports OpenSSL 1.1.1+,currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'
```
百度很多無果藕溅,卸載urllib3重新安裝都不行匕得,最后找到這一篇:python3 openssl問題(賊有用) - Captain_Li - 博客園 (cnblogs.com)
指出python中沒有編譯openssl,然后跟著操作,檢查我的python中是否編譯ssl汁掠。
```
[root@lemon Python-3.7.3]# python3 -c"import sysconfig; print(sysconfig.get_config_var('CONFIG_ARGS'))"
'--prefix=/usr/local/python3? ? ''--with-openssl=/usr/local/openssl''--enable-shared'
```
--with-openssl=/usr/local/openssl是正確的略吨,如果只有--with-ssl就可能有問題。
然后重新編譯:
```
cd Python-3.7.3
./configure --prefix=/usr/local/python3 --with-openssl=/usr/local/openssl --enable-shared
make && make install
```
等待編譯完成考阱,再執(zhí)行poetry --version翠忠。
問題解決。
重新編譯python后乞榨,使用python3時(shí)可能會(huì)出現(xiàn)以下報(bào)錯(cuò):
```
python3: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
```
需要去別的環(huán)境下找下有沒 libpython3.8.so.1.0秽之,導(dǎo)過來加到共享庫路徑LD_LIBRARY_PATH,python版本需一樣
解決吃既。