Wrong python in Sage shell?

382 views
Skip to first unread message

Simon King

unread,
Aug 29, 2019, 6:00:50 AM8/29/19
to sage-...@googlegroups.com
Hi!

The following happens with a Py-3 build of Sage: I open a sage-shell,
and then I get
(sage-sh) king@klap:src$ sage --python --version
Python 3.7.3
(sage-sh) king@klap:src$ python --version
Python 2.7.15

Is it expected that the default python version in a py-3 install is a
py-2?

Best regards,
Simon

Dima Pasechnik

unread,
Aug 29, 2019, 6:28:51 AM8/29/19
to sage-devel
is  this python2 from your OS, or from Sage's installation?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/qk87o9%2478oi%241%40blaine.gmane.org.

Vincent Delecroix

unread,
Aug 29, 2019, 6:30:21 AM8/29/19
to sage-...@googlegroups.com
It is sort of normal. [PEP0394] used to say that python
should be an alias for python2. But now it says that it
should either be python2 or python3.

Sage just follows the logic that was in place.

[PEP0394] https://www.python.org/dev/peps/pep-0394/

Vincent

Simon King

unread,
Aug 29, 2019, 6:35:46 AM8/29/19
to sage-...@googlegroups.com
Hi Dima,

On 2019-08-29, Dima Pasechnik <dim...@gmail.com> wrote:
> is this python2 from your OS, or from Sage's installation?

From Sage's installation (apparently Sage-with-py-3 also builds
python-2):

(sage-sh) king@klap:~$ which python
/home/king/Sage/git/py3/local/bin/python
(sage-sh) king@klap:~$ which python3
/home/king/Sage/git/py3/local/bin/python3

Best regards,
Simon

Frédéric Chapoton

unread,
Aug 29, 2019, 10:15:51 AM8/29/19
to sage-devel
Hello

Somebody (else) should make sure that every single remaining piece of python2 is removed from a python3 sage. In particular, we should not build python2 at all.

Frédéric

Samuel Lelievre

unread,
Aug 29, 2019, 12:02:11 PM8/29/19
to sage-devel
Possibly somewhat related (sorry if not): after building Sage
for Python 3, running `sage -t` lets the doctesting framework
decide what to set `optional` to, and apparently it uses
"python2" rather than "python3"; is this the desired behaviour?

$ ./sage --python --version
Python 3.7.3
$ ./sage -t --all -p 2
Running doctests with ID 2019-08-29-17-56-03-a7156513.
Git branch: develop
Using --optional=build,dochtml,python2,sage


Jeroen Demeyer

unread,
Aug 29, 2019, 12:13:50 PM8/29/19
to sage-...@googlegroups.com
On Thu, Aug 29, 2019 at 6:02 PM Samuel Lelievre
<samuel....@gmail.com> wrote:
> Possibly somewhat related (sorry if not): after building Sage
> for Python 3, running `sage -t` lets the doctesting framework
> decide what to set `optional` to, and apparently it uses
> "python2" rather than "python3"; is this the desired behaviour?

Yes, "python2" is installed as optional package and this is simply
running tests for that optional package. There aren't any such tests,
but the test framework doesn't a priori know that.

"python3" is not optional, therefore it's not listed in the --optional options.

I agree that it's confusing, but it's not a bug.

John H Palmieri

unread,
Aug 29, 2019, 6:01:21 PM8/29/19
to sage-devel


On Thursday, August 29, 2019 at 7:15:51 AM UTC-7, Frédéric Chapoton wrote:
Hello

Somebody (else) should make sure that every single remaining piece of python2 is removed from a python3 sage. In particular, we should not build python2 at all.

Reply all
Reply to author
Forward
0 new messages