New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? #950
Comments
What os and version are you using ? Also the fix is right there in the message you will need to go to https://github.com/pyenv/pyenv/wiki/Common-build-problems#error-the-python-ssl-extension-was-not-compiled-missing-the-openssl-lib then just copy and paste the script for your specific os |
Debian GNU/Linux 9.1 (stretch)
|
|
|
Hi, look at #945, it's because Debian 9 uses OpenSSL 1.1.0 which support in CPython was added in 3.5.3 (more details in the issue above). Cheers |
No solution to this yet? Trying to install... |
@dstyp, are you trying to install a version < 3.5.3? If so I don't know, else the above answers ( |
Worked! Thanks, completely overlooked your comment. |
+1 having same trouble installing 3.5.2 on ubuntu |
i'm having this on mac os high sierra even with setting CFLAGS and LDFLAGS correctly using brew --prefix |
@makslevental Same here. Is there a fix available for HighSierra ? |
@uber1geek the problem turned out to be the openssl hadn't actually successfully installed (even though homebrew reported that it had). run |
I'm using macOS / OSX, but not homebrew, and I'm having this issue as well. Is there a way to determine...
|
@colllin you need the openssl headers which are in the include dir. i don't know where yours would be |
I found a solution to my problem. (Fedora 26) Install: |
Mac OS X 10.13 (High Sierra) uses LibreSSL 2.2.7 but doesnt include the C headers necessary to compile the SSL extension for python. I know of no Apple-provided method to get them installed (via XCode or whatever else). To get this working without homebrew or any other shenanigans (assuming you have pyenv installed and working properly);
(post edit) |
I tried all suggestions above but it is not working on Hight Sierra 10.13.1 Beta (17B25c) and Xcode 9 |
@matheusabr I use @makslevental's method and it works |
@crazyxrp It really works! Thanks |
install
Source: https://stackoverflow.com/questions/6171210/building-python-and-more-on-missing-modules |
On Debian stretch, installing |
@laenderoliveira
|
In my case (Homebrew, OSX 10.13.1 - High Sierra) I had to specify both CFLAGS and CPPFLAGS: |
@Beenhakker |
Not working for me to install 2.7.14 :( |
Not working for me to install 2.7.6 |
@Beenhakker Thanks! |
Had this issue on Ubuntu 22.04 Jammy Jellyfish. The solution was
|
somewhat of a tangent but in addition to the above
otherwise I would get
|
Had this issue trying to install Python version |
It's my first time using Then I ran into the following issue on my ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? Here is the complete output: $ pyenv install 3.9.13
Downloading Python-3.9.13.tar.xz...
-> https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tar.xz
Installing Python-3.9.13...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python curses extension was not compiled. Missing the ncurses lib?
WARNING: The Python ctypes extension was not compiled. Missing the libffi lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (Ubuntu 22.04 using python-build 2.3.2-10-gff9d3ca6)
Inspect or clean up the working tree at /tmp/python-build.20220728154121.11959
Results logged to /tmp/python-build.20220728154121.11959.log
Last 10 log lines:
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpqhrtnxrs
Processing /tmp/tmpqhrtnxrs/setuptools-58.1.0-py3-none-any.whl
Processing /tmp/tmpqhrtnxrs/pip-22.0.4-py3-none-any.whl
Installing collected packages: setuptools, pip
WARNING: The scripts pip3 and pip3.9 are installed in '/home/kristof/.pyenv/versions/3.9.13/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.0.4 setuptools-58.1.0 Attempting to install $ sudo apt-get -y install python-openssl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-openssl Luckily I found out about $ sudo apt -y install libssl-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
chromium-codecs-ffmpeg-extra fonts-font-awesome fonts-lato gstreamer1.0-vaapi
libgstreamer-plugins-bad1.0-0 libjs-bootstrap4 libjs-highlight.js libjs-lunr
libjs-modernizr libjs-popper.js libjs-sizzle libva-wayland2 mkdocs node-jquery
python-babel-localedata python3-argcomplete python3-babel python3-jinja2
python3-livereload python3-markdown python3-packaging python3-psutil python3-pygments
python3-pyinotify python3-tornado python3-userpath sphinx-rtd-theme-common
Use 'sudo apt autoremove' to remove them.
Suggested packages:
libssl-doc
The following NEW packages will be installed:
libssl-dev
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 2.370 kB of archives.
After this operation, 12,4 MB of additional disk space will be used.
Get:1 http://be.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libssl-dev amd64 3.0.2-0ubuntu1.6 [2.370 kB]
Fetched 2.370 kB in 10s (243 kB/s)
Selecting previously unselected package libssl-dev:amd64.
(Reading database ... 206635 files and directories currently installed.)
Preparing to unpack .../libssl-dev_3.0.2-0ubuntu1.6_amd64.deb ...
Unpacking libssl-dev:amd64 (3.0.2-0ubuntu1.6) ...
Setting up libssl-dev:amd64 (3.0.2-0ubuntu1.6) ... Now it works: $ pyenv install 3.9.13
Downloading Python-3.9.13.tar.xz...
-> https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tar.xz
Installing Python-3.9.13...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python curses extension was not compiled. Missing the ncurses lib?
WARNING: The Python ctypes extension was not compiled. Missing the libffi lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
WARNING: The Python tkinter extension was not compiled and GUI subsystem has been detected. Missing the Tk toolkit?
WARNING: The Python lzma extension was not compiled. Missing the lzma lib?
Installed Python-3.9.13 to /home/kristof/.pyenv/versions/3.9.13 To fix the warnings, I did: $ sudo apt install ncurses-dev
$ sudo apt install libffi-dev
$ sudo apt install libreadline-dev
$ sudo apt install sqlite3 libsqlite3-dev
$ sudo apt install tk-dev
# I tried installing bzip2, but that seems to be ignored when pyenv compiles
# python. I found somewhere that I must then install libbz2-dev instead:
$ sudo apt install bzip2
$ sudo apt install libbz2-dev
# Same problem for lzma. I found that I must install liblzma-dev instead:
$ sudo apt install lzma
$ sudo apt install liblzma-dev Now it works without warnings: $ pyenv install 3.9.13
pyenv: /home/kristof/.pyenv/versions/3.9.13 already exists
continue with installation? (y/N) y
Downloading Python-3.9.13.tar.xz...
-> https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tar.xz
Installing Python-3.9.13...
Installed Python-3.9.13 to /home/kristof/.pyenv/versions/3.9.13 |
@kristofmulier We cannot vouch for the accuracy and completeness of 3rd-party guides. Our README has up-to-date, official installation instructions. |
- Add new version 3.10.x support. - Bump 3.8.x, 3.9.x to the latest update. - Bump the pyenv version to v2.3.3. - Remove deprecated versions of python: (3.4.10, 3.5.10, 3.6.13, 3.7.10) - Refactor the python-install role to address 'line too long' error while building the pyenv command. - Install compact-openssl10 dependencies for python 3.10 ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? The compat-openssl libs are available only for CentOS8, so python 3.10x will be available for >= CentOS8. - Include libssl-dev required for building Ubuntu {18,20}.04 Issue-ID: RELENG-4357 Ref: pyenv/pyenv#950 Change-Id: I3fe4fed872a43bf21a07fefc6c161b143f306ca2 Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Thanks a lot man!! Been struggling to install python 3.2 on Ubuntu 22.04 until I found your post! |
On Amazon Linux 2, pyenv install -v 3.10.x required removing openssl-devel and installing openssl11-devel instead:
|
After all the efforts, I find that use a self-compiled openssl is the easiest way to solve. Here is my script: #!/bin/bash
cd ~/.pyenv
mkdir build
cd build
# download a latest version of openssl
wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz.sha256
wget https://www.openssl.org/source/openssl-1.1.1s.tar.gz
# do check sha256 before compile it
sha256sum openssl-1.1.1s.tar.gz
tar xf openssl-1.1.1s.tar.gz
cd openssl-1.1.1s
# compile
./config no-shared # MUST use `no-shared` config, or you will always need LD_LIBRARY_PATH env
make -j32
make test
cd ~/.pyenv/build/openssl-1.1.1s
CFLAGS=-I$(pwd)/include LDFLAGS=-L$(pwd) ~/.pyenv/bin/pyenv install 3.11.1 Now everything works. |
Hey @ladyrick, that's super useful information! However, when I tried to build py3.11 on ubuntu 16.04, it still hit the
I'm not sure what happened, can anyone help take a look? Thanks in advance! |
maybe upgrade your pyenv and install 3.11.1 instead? |
Thanks for reply! This issue constantly exists and I'm able to use docker to reproduce it:
The command to run is |
Hah, py3.11+ubuntu1604 is somewhat special: You need to use
This dockerfile works:
|
the following command fixed my case, maybe it's helpful to you. My pyenv version is '2.3.14-3-g6052caa0' env PYTHON_CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl)" pyenv install -v <your-python-version> |
Do not forget to |
The current advisory on the subject topic is at https://github.com/pyenv/pyenv/wiki/Common-build-problems#error-the-python-ssl-extension-was-not-compiled-missing-the-openssl-lib |
the following command fixed my case , thank you very much |
I faced a similar issue with openssl and used this hack to install python 3.9.17 using pyenv on my MAC 13.4.1. Thanks! |
Running on linux (Pop_OS) the following one-liner fixed my install issues with 3.10.13, imagine it will work for other ubuntu / apt style distros. sudo apt install --no-install-recommends \
libssl-dev \
ncurses-dev \
libffi-dev \
libreadline-dev \
sqlite3 libsqlite3-dev \
tk-dev \
bzip2 libbz2-dev \
lzma liblzma-dev |
Make sure to use If you are using brew, add this to
If you are using brew, add this to
|
Turn out I haven't install openssl |
if you are trying to install python3.10+ by pyenv and you are in Ubuntu 20.04.6 and your OpenSSL is installed by linuxbrew..
export those 2 vars then use |
ty so much, so helpful on elementary os also |
thank you for this, but it does not seem to work for |
For platforms that don't have an option to upgrade to OpenSSL 1.1.1+ (e.g. Debian 8, that has OpenSSL up to only 1.1.0 in standard package repo), you can build custom OpenSSL and build Python against that: curl -O https://www.openssl.org/source/openssl-VERSION.tar.gz
tar xzf openssl-VERSION.tar.gz
cd openssl-VERSION
./config \
--prefix=/usr/local/custom-openssl \
--libdir=lib \
--openssldir=$(find /etc/ -name openssl.cnf -quit -printf "%h" 2>/dev/null)
make -j1 depend
make -j8
make install_sw
cd - openssldir and install_sw is important if you don't want to override your current |
I used Rocky Linux 9.3 ,and got two diff openssl :
but
|
➜ ~ pyenv install 3.5.2
Installing Python-3.5.2...
patching file Lib/venv/scripts/posix/activate.fish
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (Deepin 15.4 using python-build 20160602)
Inspect or clean up the working tree at /tmp/python-build.20170717074120.10900
Results logged to /tmp/python-build.20170717074120.10900.log
Last 10 log lines:
(cd /home/zonzely/.pyenv/versions/3.5.2/share/man/man1; ln -s python3.5.1 python3.1)
if test "xupgrade" != "xno" ; then
case upgrade in
upgrade) ensurepip="--upgrade" ;;
install|*) ensurepip="" ;;
esac;
./python -E -m ensurepip
$ensurepip --root=/ ;
fi
Ignoring ensurepip failure: pip 8.1.1 requires SSL/TLS
The text was updated successfully, but these errors were encountered: