SageMath 8.2 Docker image: pip lacks SSL support

173 views
Skip to first unread message

Nathan Dunfield

unread,
May 16, 2018, 4:06:54 PM5/16/18
to sage-devel
Just tried out the latest Sage Docker image and, unlike all previous versions, I can no longer use pip to fetch packages off PyPI:

docker run -it sagemath/sagemath:8.2 /bin/bash
sage@6bf664a266cd:~/sage$ sage -pip install FXrays
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting FXrays
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/fxrays/
[...]
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/fxrays/
  Could not fetch URL https://pypi.python.org/simple/fxrays/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/fxrays/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
  Could not find a version that satisfies the requirement FXrays (from versions: )
No matching distribution found for FXrays

If I do

sudo apt-get update; sudo apt-get install -y openssl

in the container then pip starts working again.  So it looks like Python was compiled with SSL support but somehow the openssl module itself gets removed somewhere in the process.

Thanks,

Nathan

Emmanuel Charpentier

unread,
May 17, 2018, 6:16:50 AM5/17/18
to sage-devel
I have met this problem, which occurs when OpenSSL isn't available systemwide (there is a saga somewhere in sage-devel's archive, around spring 2017 IIRC...). I have personally checked that Sage's pip is (or was, at the time) unable to use SSL when compiled against Gnu TLS alone...

This should be fixed when I come around to implement Trac#24107, which has become somewhat urgent...

In the interim, could you try to install OpenSSL and its development files a,d reinstall Sage's pip ?

--
Emmanuel Charpentier

Nathan Dunfield

unread,
May 17, 2018, 9:53:59 AM5/17/18
to sage-devel
In the interim, could you try to install OpenSSL and its development files a,d reinstall Sage's pip ?

Actually, I fixed the problem simply by installing the (non-development) Ubuntu package "openssl".  In particular, I did not need to reinstall or rebuild any part of Sage itself.   I'm guessing that the "openssl" package was accidentally removed from the Docker image after Sage was built.

Nathan

Erik Bray

unread,
May 17, 2018, 12:20:35 PM5/17/18
to sage-devel, Julian Rüth
*ping* Julian who built the 8.2 docker image...
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

Julian Rüth

unread,
May 26, 2018, 7:43:14 PM5/26/18
to sage-devel
Thanks for reporting this and even providing a workaround :)

You are right, Sage was built with libssl-dev but the final container had been missing openssl. I fixed it for the 8.2 build and pushed a new image to the Docker Hub.

julian

Nathan Dunfield

unread,
May 27, 2018, 7:12:36 PM5/27/18
to sage-devel
On Saturday, May 26, 2018 at 7:43:14 PM UTC-4, Julian Rüth wrote:
Thanks for reporting this and even providing a workaround :)

You are right, Sage was built with libssl-dev but the final container had been missing openssl. I fixed it for the 8.2 build and pushed a new image to the Docker Hub.

Great, the fixed version works for me.   Thanks for fixing this!

Nathan

Reply all
Reply to author
Forward
0 new messages