解決python3缺乏zlib的問題
Table of Contents
在使用python3運行spark時,報缺乏zlib的錯誤。解決方法以下。
java
1 安裝zlib
wget http://zlib.net/zlib-1.2.8.tar.gz tar -xvf zlib-1.2.8.tar.gz cd zlib-1.2.8 ./configure make make install
2 從新編譯安裝python
cd ../Python-3.4.5 ./configure --prefix=/usr/python3.4.5/ make make install
若是是第一次安裝python,能夠創建一個軟鏈接,讓python2和python能夠同時使用,並且python仍是原來的2.x。
python
ln -s /usr/python3.4.5/bin/python3 /usr/bin/python3
3 補充說明
網上有些同窗說的使用 –with-zlib進行配置的方法(以下)對於python3.4.5並不須要,也不識別該參數,直接運行上面的配置命令便可。
sql
./configure --prefix=/usr/python3.4.5/ --with-zlib=xxxx