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.

$ 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.

Reply via email to