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.Sun, 05 Apr 2020 20:59:18 +0200How to use a python lib by sageMath?https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/ Hello,
Here's my problem :
I have sage v.9 in my Debian 4.9 and I want to use it by importing a python lib that I downloaded from a private repo on Github. This library is in a repo in which there is a makefile in which I have to indicate the path of sage's binary, otherwise I can't run a make.
The first line of the makefile is :
```SAGE=```
but the problem is, I don't know what is the path I should indicate. To launch sagev9, I do ```cd /home/my_name/SageMath/ && ./sage```.
So with ```HOME=/home/my_name```, I tried :
```SAGE=$(HOME)/SageMath/sage```
```SAGE=$(HOME)/SageMath/local/bin/sage```
```SAGE=$(HOME)/SageMath/src/bin/sage```
but none of them works. When I type make, I received the error : **Error: You must set the SAGE_ROOT environment variable or run this
script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory.
Error setting environment variables by sourcing '/home/rachidi/SageMath/local/bin/sage-env';**
Do you please know what path I have to indicate?
Thanks.Sat, 04 Apr 2020 13:27:38 +0200https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/Comment by John Palmieri for <p>Hello,</p>
<p>Here's my problem :</p>
<p>I have sage v.9 in my Debian 4.9 and I want to use it by importing a python lib that I downloaded from a private repo on Github. This library is in a repo in which there is a makefile in which I have to indicate the path of sage's binary, otherwise I can't run a make.
The first line of the makefile is :
<code>SAGE=</code>
but the problem is, I don't know what is the path I should indicate. To launch sagev9, I do <code>cd /home/my_name/SageMath/ && ./sage</code>.</p>
<p>So with <code>HOME=/home/my_name</code>, I tried :</p>
<p><code>SAGE=$(HOME)/SageMath/sage</code></p>
<p><code>SAGE=$(HOME)/SageMath/local/bin/sage</code></p>
<p><code>SAGE=$(HOME)/SageMath/src/bin/sage</code></p>
<p>but none of them works. When I type make, I received the error : <strong>Error: You must set the SAGE_ROOT environment variable or run this
script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory.
Error setting environment variables by sourcing '/home/rachidi/SageMath/local/bin/sage-env';</strong></p>
<p>Do you please know what path I have to indicate?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50512#post-id-50512Also being discussed at https://stackoverflow.com/questions/61020062/how-to-use-a-python-lib-by-sagemathSat, 04 Apr 2020 17:07:20 +0200https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50512#post-id-50512Answer by vdelecroix for <p>Hello,</p>
<p>Here's my problem :</p>
<p>I have sage v.9 in my Debian 4.9 and I want to use it by importing a python lib that I downloaded from a private repo on Github. This library is in a repo in which there is a makefile in which I have to indicate the path of sage's binary, otherwise I can't run a make.
The first line of the makefile is :
<code>SAGE=</code>
but the problem is, I don't know what is the path I should indicate. To launch sagev9, I do <code>cd /home/my_name/SageMath/ && ./sage</code>.</p>
<p>So with <code>HOME=/home/my_name</code>, I tried :</p>
<p><code>SAGE=$(HOME)/SageMath/sage</code></p>
<p><code>SAGE=$(HOME)/SageMath/local/bin/sage</code></p>
<p><code>SAGE=$(HOME)/SageMath/src/bin/sage</code></p>
<p>but none of them works. When I type make, I received the error : <strong>Error: You must set the SAGE_ROOT environment variable or run this
script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory.
Error setting environment variables by sourcing '/home/rachidi/SageMath/local/bin/sage-env';</strong></p>
<p>Do you please know what path I have to indicate?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?answer=50520#post-id-50520You could try to switch to the sage shell environment
$ /home/my_name/SageMath/sage -sh
And then run make.Sat, 04 Apr 2020 19:21:35 +0200https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?answer=50520#post-id-50520Answer by Sébastien for <p>Hello,</p>
<p>Here's my problem :</p>
<p>I have sage v.9 in my Debian 4.9 and I want to use it by importing a python lib that I downloaded from a private repo on Github. This library is in a repo in which there is a makefile in which I have to indicate the path of sage's binary, otherwise I can't run a make.
The first line of the makefile is :
<code>SAGE=</code>
but the problem is, I don't know what is the path I should indicate. To launch sagev9, I do <code>cd /home/my_name/SageMath/ && ./sage</code>.</p>
<p>So with <code>HOME=/home/my_name</code>, I tried :</p>
<p><code>SAGE=$(HOME)/SageMath/sage</code></p>
<p><code>SAGE=$(HOME)/SageMath/local/bin/sage</code></p>
<p><code>SAGE=$(HOME)/SageMath/src/bin/sage</code></p>
<p>but none of them works. When I type make, I received the error : <strong>Error: You must set the SAGE_ROOT environment variable or run this
script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory.
Error setting environment variables by sourcing '/home/rachidi/SageMath/local/bin/sage-env';</strong></p>
<p>Do you please know what path I have to indicate?</p>
<p>Thanks.</p>
https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?answer=50532#post-id-50532Did you try to specify the path that contains the script sage? , i.e., just
SAGE=$(HOME)/SageMath
which is the usual `SAGE_ROOT` folder.Sat, 04 Apr 2020 22:48:57 +0200https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?answer=50532#post-id-50532Comment by John Palmieri for <p>Did you try to specify the path that contains the script sage? , i.e., just</p>
<pre><code>SAGE=$(HOME)/SageMath
</code></pre>
<p>which is the usual <code>SAGE_ROOT</code> folder.</p>
https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50534#post-id-50534As I said, this is also being discussed at https://stackoverflow.com/questions/61020062/how-to-use-a-python-lib-by-sagemath, and I asked that question there.Sat, 04 Apr 2020 23:40:09 +0200https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50534#post-id-50534Comment by Sébastien for <p>Did you try to specify the path that contains the script sage? , i.e., just</p>
<pre><code>SAGE=$(HOME)/SageMath
</code></pre>
<p>which is the usual <code>SAGE_ROOT</code> folder.</p>
https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50548#post-id-50548oups, excuse me.Sun, 05 Apr 2020 17:29:42 +0200https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50548#post-id-50548Comment by John Palmieri for <p>Did you try to specify the path that contains the script sage? , i.e., just</p>
<pre><code>SAGE=$(HOME)/SageMath
</code></pre>
<p>which is the usual <code>SAGE_ROOT</code> folder.</p>
https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50563#post-id-50563I'm just trying to avoid duplication of effort.Sun, 05 Apr 2020 20:59:18 +0200https://ask.sagemath.org/question/50510/how-to-use-a-python-lib-by-sagemath/?comment=50563#post-id-50563