Skip to content

Instantly share code, notes, and snippets.

@tobiase
Forked from tianchaijz/pyenv_ssl_archlinux.sh
Created March 1, 2018 10:47
Show Gist options
  • Select an option

  • Save tobiase/d2c48cf36a85447a060a18f2bd63a8a1 to your computer and use it in GitHub Desktop.

Select an option

Save tobiase/d2c48cf36a85447a060a18f2bd63a8a1 to your computer and use it in GitHub Desktop.
Script to solve python compilation with ssl on Arch Linux
#!/bin/bash
# http://stackoverflow.com/questions/23548188/how-do-i-compile-python-3-4-with-custom-openssl
openssl_version="openssl-1.0.2g"
openssl_package="${openssl_version}.tar.gz"
openssl_path="/opt/$openssl_version"
curl https://www.openssl.org/source/$openssl_package | tar xz && cd $openssl_version && ./config shared --prefix=$openssl_path && make -j8 && sudo make install
export LDFLAGS="-L$openssl_path/lib -Wl,-rpath=$openssl_path/lib"
export LD_LIBRARY_PATH="$openssl_path/lib"
export CPPFLAGS="-I$openssl_path/include/openssl"
# pythonbrew install 2.7.8
pyenv install 2.7.8
pyenv local 2.7.8
exec $SHELL
python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment