Ask Your Question

Is it possible to import machine learning libraries in Sage?

asked 2019-01-10 01:54:55 -0600

Stockfish3709 gravatar image

I'm doing a machine learning program in Sage and I wish to use Tensorflow or Scikit learn. However, I don't see any way to import the modules in Sage. I'm wondering if it is possible to import other modules outside of Sage into Sage, or if Sage is essentially a black box system that doesn't work with any other module.

edit retag flag offensive close merge delete



you can import any python module that is installed in sage's own python.

FrédéricC gravatar imageFrédéricC ( 2019-01-10 01:57:27 -0600 )edit

or more precisely in the python used by sage, which can be the system's python, depending on the way you installed sage.

FrédéricC gravatar imageFrédéricC ( 2019-01-10 10:22:29 -0600 )edit

1 answer

Sort by » oldest newest most voted

answered 2019-01-10 10:28:44 -0600

tmonteil gravatar image

You have to install the Python packages in the Sage virtual environement. For this, you have to open a terminal (assuming you are using GNU/Linux) and type:

sage --pip install tensorflow

And then, from Sage:

sage: import tensorflow
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-01-10 01:54:55 -0600

Seen: 46 times

Last updated: Jan 10