ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 10 Jan 2019 10:28:44 -0600Is it possible to import machine learning libraries in Sage?http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/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. Thu, 10 Jan 2019 01:54:55 -0600http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/Comment by FrédéricC for <p>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. </p>
http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?comment=44985#post-id-44985or more precisely in the python used by sage, which can be the system's python, depending on the way you installed sage.Thu, 10 Jan 2019 10:22:29 -0600http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?comment=44985#post-id-44985Comment by FrédéricC for <p>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. </p>
http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?comment=44978#post-id-44978you can import any python module that is installed in sage's own python.Thu, 10 Jan 2019 01:57:27 -0600http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?comment=44978#post-id-44978Answer by tmonteil for <p>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. </p>
http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?answer=44986#post-id-44986You 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 tensorflowThu, 10 Jan 2019 10:28:44 -0600http://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?answer=44986#post-id-44986