ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 10 Jan 2019 17:28:44 +0100Is it possible to import machine learning libraries in Sage?https://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 08:54:55 +0100https://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>
https://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 08:57:27 +0100https://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?comment=44978#post-id-44978Comment 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>
https://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 17:22:29 +0100https://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?comment=44985#post-id-44985Answer 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>
https://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 17:28:44 +0100https://ask.sagemath.org/question/44977/is-it-possible-to-import-machine-learning-libraries-in-sage/?answer=44986#post-id-44986