首頁 > 軟體

【Python學習問題集錦】pip 安裝模組出錯問題

2021-05-27 22:00:07

學習python,隨著學習的深入,總是會學習到用第三方庫來解決問題的案例。但是往往學習還未開始,便會遇到攔路虎,那就是在安裝所需的第三方庫模組時,總是會出現各種各樣的問題,報各式各樣的錯。

這時候,用對的方法來解決問題就顯得特別有必要。當然,解決問題的過程也是一種學習的過程。自然,也能解除我們一籌莫展的苦惱。

【問題情境】

win10系統安裝好了Anaconda軟體,在cmd命令列下輸入pip install myqr,顯示:

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

【解決方法】

1、解決方法為到https://slproweb.com/products/Win32OpenSSL.html上下載winopessl,直接下載第一個MSI安裝即可:

2、

安裝MSI的過程中,記住安裝路徑選擇:AnacondaAnaconda3Libsite-packages,然後一直預設下一步,最後一步選第二個。

3、MSI安裝成功後,再到命令列介面pip試試:

這時候就會顯示成功安裝啦!

C:UsersFZYZ>pip install myqrCollecting myqrUsing cached MyQR-2.3.1.zip (16 kB)Requirement already satisfied: imageio>=1.5 in c:programdataanaconda3libsite-packages (from myqr) (2.9.0)Requirement already satisfied: numpy>=1.11.1 in c:programdataanaconda3libsite-packages (from myqr) (1.18.5)Requirement already satisfied: Pillow>=3.3.1 in c:programdataanaconda3libsite-packages (from myqr) (7.2.0)Building wheels for collected packages: myqr Building wheel for myqr (setup.py) ... done Created wheel for myqr: filename=MyQR-2.3.1-py3-none-any.whl size=16673 sha256=4d5cd4d3f26c7d74003627c1d493bf59b5da1217e102d89bc33b1ea3ee3d789c Stored in directory: c:usersfzyzappdatalocalpipcachewheelsf8b0381c1fd37a94a2046d4fda17344fbecb454f1a907e8482d6d82Successfully built myqrInstalling collected packages: myqrSuccessfully installed myqr-2.3.1

至此,大功告成,問題解決啦!接下來可以愉快地用我們安裝的模組來開展學習了!


IT145.com E-mail:sddin#qq.com