2021年3月15日 星期一

[linux] Build Python 3 with openssl on raspberry pi

  Build Python 3 with openssl on raspberry pi

 

 cd /opt/pythonbuild/

 wget https://ftp.openssl.org/source/old/1.1.1/openssl-1.1.1c.tar.gz

 tar xvf openssl-1.1.1c.tar.gz

 cd

 /opt/pythonbuild/openssl-1.1.1c# ./config --prefix=$HOME/.local/ssl

 cd /opt/pythonbuild/

 wget https://www.python.org/ftp/python/3.8.8/Python-3.8.8.tgz

 cd Python-3.8.8

 ./configure --with-openssl=$HOME/.local/ssl

 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/ssl/lib

 time make -j4 && make install

 python --version

 python3 --version

 Python 3.8.8

 python3 -c 'import ssl'