2020-09-11 17:55 UTC, Markus Wageringel:
>
> With a clean build on Ubuntu 20.04, ptestlong passes, but Jupyter
> does not start anymore due to an SSL problem, using Sage's Python 3.
> (The system Python 3.8 is not picked up because of missing
> dependencies sqlite and xz, but that is ok.)
>
>     $ ./sage -n jupyter
>     Please wait while the Sage Jupyter Notebook server starts...
>     Traceback (most recent call last):
>     ...
>         import _ssl             # if we can't import it, let the error 
> propagate
>     ModuleNotFoundError: No module named '_ssl'
>
>     The Jupyter notebook requires ssl, even if you do not use
>     https. Install the openssl development packages in your system and
>     then rebuild Python (sage -f python3).
>
> Which packages need to be installed for this and why was this not
> a problem previously? OpenSSL is installed on the system:
>
>     $ openssl version
>     OpenSSL 1.1.1f  31 Mar 2020

The build system apparently did not build Python's
`_ssl` module when it built Python. It is supposed to
always build it provided openssl is present, either from
the system or built as an spkg.

Or could it be that your system has OpenSSL but not
libssl-dev, as Matthias suggests?

2020-09-11 18:17 UTC, Matthias Köppe:
>
> Is "libssl-dev" installed?
> (see build/pkgs/openssl/distros/debian.txt)

On Debian or Debian-based system like Ubuntu, check whether
libssl-dev is installed with this command (sudo not needed):
```
$ dpkg-query --list libssl-dev
```

If indeed it was not installed, do this:
```
$ sudo apt install libssl-dev
$ ./sage -f python3
```

Oh, but you replied to Matthias now:

2020-09-11 18:34 UTC, Markus Wageringel
>
> It looks like it is not:

In the meantime I had opened a ticket:

- Build Python's ssl module
  https://trac.sagemath.org/ticket/30556

in which I forgot about the libssl vs libssl-dev subtlety.

I'll change the ticket's goal to

- Warn when building Python without its SSL module

I know when there are errors, they are summarized
at the end of the build. Do we have a mechanism
to collect warnings and summarise them at the end
of the build?

It would be very useful when building on a system
without the appropriate ssl dependencies like yours
or most macOS systems to end the build with a word
such as

  Sage was successfully built, and starts,
  but be warned, it build its own Python
  without the SSL module. To know more, visit
    <some documentation or wiki page>

Would there be a way to make `sage -n jupyter` first check
for the ssl module, and if it is not found provide some
helpful error message with hints as to how to fix things?

If you get a chance to ask someone with sudo rights
on the machine you were using, have them install all
the pieces you were missing: xz, sqlite, libssl-dev,
for next time!

See at the end of the output of `./configure` for a list
of recommended packages to install system-wide.

In the meantime a workaround as you guessed is to build
Sage's openssl spkg and rebuild Sage's Python so it takes
advantage of it:
```
$ ./sage -i openssl
$ ./sage -f python3
```

This last command will also rebuild any packages
that depend on the `python3` spkg.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-release+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-release/CAEcArF1hjuRS0u982FznHqjQcN6aopJHmAbmHbs44yHrTbgcpw%40mail.gmail.com.

Reply via email to