On Tue, 15 Aug 2023, 07:41 'Michel VAN DEN BERGH' via sage-support, < sage-support@googlegroups.com> wrote:
> > > On Tuesday, August 15, 2023 at 8:11:35 AM UTC+2 Michel VAN DEN BERGH wrote: > > On Monday, August 14, 2023 at 10:45:32 AM UTC+2 Henri Girard wrote: > > Did you make a link to your compiled version ? > > I compiled sage in sage (which us the base dir) after I sudo ln -s /sage > /usr/bin/sage then you get sage wide > > > I don't use the sage executable, but I do "import sage" inside the python > interpreter (I only run scripts). This used to work with the distro sage, > but I have not found how to make that work with the compiled sage. Do you > know how to achieve this? > > Michel > > > I did some investigating and it seems that the distro sage installs sage > as an honest module (it is in the file system as > /usr/lib/python3/dist-packages/sage/) whereas the python that comes with > the compiled sage has sage as a built-in module (it seems to be not in the > file system). So it is not accessible to the global python I think. > > The following is for the sage python. > You need to either make symbolic link to the place you build Sage from source, or just cd to that location, and run ./sage --python > $ sage --python > >>> import sage > >>> import inspect > >>> inspect.getfile(sage) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File > "/home/sage_user/sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/inspect.py", > line 901, in getfile > raise TypeError('{!r} is a built-in module'.format(object)) > TypeError: <module 'sage' (<_frozen_importlib_external.NamespaceLoader > object at 0x7fa4431b2550>)> is a built-in module > >>> > > > > > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-support/cdf03f5c-2ad1-4d0a-a4c5-06a1b3fec632n%40googlegroups.com > <https://groups.google.com/d/msgid/sage-support/cdf03f5c-2ad1-4d0a-a4c5-06a1b3fec632n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/CAAWYfq0HNUX%2BLq4t_tjxdLPrZGkXZYFqzpQGt132ZM8D%2BXMsQQ%40mail.gmail.com.