我正在嘗試使用 Pyenv 安裝 Python 2.7.8 和 Python 3.6.7 但我總是遇到同樣的問題:
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
BUILD FAILED (Ubuntu 18.04 using python-build 20180424)
Inspect or clean up the working tree at /tmp/python-build.20190531162212.22464
Results logged to /tmp/python-build.20190531162212.22464.log
Last 10 log lines:
install|*) ensurepip="" ;; \
esac; \
./python -E -m ensurepip \
$ensurepip --root=/ ; \
我已經嘗試了pyenv常見問題中的所有可能性並更改了OPENSSL版本。
答案1
我認為發生的事情是你的 python 版本和 pyenv python 版本之間的路徑問題。
您必須透過別名或其他內容將 python 版本硬編碼到 .bashrc 檔案中。
只是 :
- 卸載 pyenv
- 進入 bashrc 檔案並刪除 python 別名
- 再次安裝pyenv