Created
June 17, 2019 15:35
-
-
Save nuga99/95579e56a32d80501f99445410e3ace2 to your computer and use it in GitHub Desktop.
[Solved] Ignoring ensurepip failure pip requires ssl/tls error in Debian Based (Ubuntu, Parrot, Debian, etc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# Note: it is a script to solve Ubuntu 18.04 LTS also Parrot OS 4.7 | |
# different version of pythons compiling header confliction problems | |
# | |
# The idea is got from @JustAnotherArivist | |
# From URL: https://github.com/pyenv/pyenv/issues/945 | |
# | |
# The script used in here is with slightly modifications | |
# to fit many different SSL header versions | |
# First under your home directory make OpenSSL library | |
# and extract useful package | |
mkdir ~/libssl1.0-dev | |
cd ~/libssl1.0-dev | |
apt-get download libssl1.0-dev | |
ar x libssl1.0-dev* data.tar.xz | |
tar -xf data.tar.xz --strip-components=2 | |
# Second, specifically get your current system's SSL headers | |
# and make symbolic-links | |
libcrypto=$(ls /usr/lib/x86_64-linux-gnu/ | grep libcrypto.so......) | |
libssl=$(ls /usr/lib/x86_64-linux-gnu/ | grep libssl.so......) | |
ln -s /usr/lib/x86_64-linux-gnu/${libcrypto} ~/libssl1.0-dev/lib/x86_64-linux-gnu | |
ln -s /usr/lib/x86_64-linux-gnu/${libssl} ~/libssl1.0-dev/lib/x86_64-linux-gnu | |
# Set your CFLAGS LDFLAGS compile options | |
# And use pyenv install the python version <3.4.5 or <3.5.3 | |
# Note: it is a one line command | |
# Please change the version of python that you want to compile | |
CFLAGS="-I${HOME}/libssl1.0-dev/include -I${HOME}/libssl1.0-dev/include/x86_64-linux-gnu" \ | |
LDFLAGS="-L${HOME}/libssl1.0-dev/lib/x86_64-linux-gnu" \ | |
pyenv install 3.5.0 # python version less then 2.7.13, 3.5.3 and 3.6+ | |
# Remove tempor libssl1.0-dev direcotory | |
rm -rf ~/libssl1.0-dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment