There is a function within sage, latex, that I want to use in directly from the command line, without dropping into sage the sage client. one way I think this may be possible is to include that sage module into my python script.
using pip install sage doesn't work.
any ideas?
You can't just install Sage as a package with a package, and there is tons of non-Python code in Sage, so it would be hard to do this a priori.
However, you can call Sage from a script pretty easily. Here is an example.
For anyone finding this, in general ask.sagemath.org is going to be a quicker way to get responses - I didn't even know that stackoverflow had a Sage tag.
Yes, but only if you run the script using the special version of Python that is bundled with Sage.
From Sage's docs http://www.sagemath.org/doc/faq/faq-usage.html#how-do-i-import-sage-into-a-python-script
You can import Sage as a library in a Python script. One caveat is that you need to run that Python script using the version of Python that is bundled with Sage; currently Python 2.6.x. To import Sage, put the following in your Python script:
from sage.all import *
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With