sage with python3

39 views
Skip to first unread message

Александр Ватузов

unread,
Nov 2, 2019, 9:04:12 AM11/2/19
to sage-support
Hi! I have an instruction here https://wiki.sagemath.org/Python3-compatible%20code , how to build sage with python3. But sage uses, I think, its own python3. So when sage wants to import something, sage can't do it, because libs are installed on system python3. Mosule six for example. I had an idea, make smth like this:

import importlib.util
spec = importlib.util.spec_from_file_location("six", "/usr/lib/python3/dist-packages/six.py")
six = importlib.util.module_from_spec(spec)
spec.loader.exec_module(six)

but it doesn't work with numpy. Help me please! May be I can change sage python to my system python3?

Dima Pasechnik

unread,
Nov 2, 2019, 9:17:00 AM11/2/19
to sage-support, sage-packaging
Several Linux distributions and Conda install Sage with system (in case of Conda it is Conda's Python) Python; they have patches allowing them to do so.
Not sure which ones already have this for Python3 (apart from Conda).

And we are planning to allow the use of system Python in the source Sage installation, too, but it is quite a bit of work.

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/21d2fb8e-1b79-4fe2-b493-808f6fa6940b%40googlegroups.com.

Александр Ватузов

unread,
Nov 2, 2019, 12:52:23 PM11/2/19
to sage-support
I resolved this problem by changing sys.path. Do you know about any problems with ubuntu19.09? I lost my installed sage after upgrade from 19.04, I don't see sage on reposytory...

But I still can download and run standart sage with python2.7

суббота, 2 ноября 2019 г., 16:17:00 UTC+3 пользователь Dima Pasechnik написал:
Several Linux distributions and Conda install Sage with system (in case of Conda it is Conda's Python) Python; they have patches allowing them to do so.
Not sure which ones already have this for Python3 (apart from Conda).

And we are planning to allow the use of system Python in the source Sage installation, too, but it is quite a bit of work.

On Sat, 2 Nov 2019, 15:04 Александр Ватузов, <amva...@gmail.com> wrote:
Hi! I have an instruction here https://wiki.sagemath.org/Python3-compatible%20code , how to build sage with python3. But sage uses, I think, its own python3. So when sage wants to import something, sage can't do it, because libs are installed on system python3. Mosule six for example. I had an idea, make smth like this:

import importlib.util
spec = importlib.util.spec_from_file_location("six", "/usr/lib/python3/dist-packages/six.py")
six = importlib.util.module_from_spec(spec)
spec.loader.exec_module(six)

but it doesn't work with numpy. Help me please! May be I can change sage python to my system python3?

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-s...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages