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, 15 Sep 2016 07:13:28 -0500/sage: line 334: path/sage-ipython: Permission deniedhttp://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/I get an error like this one when I try to start sage.
/sage: line 334: path/sage-ipython: Permission denied
It does start (with related errors), however, when I run
$ sudo sage
I might need help providing the right details, but here goes:
usrname$ sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
/Users/usrname/sage/src/bin/sage: line 334: /Users/usrname/sage/src/bin/sage-ipython: Permission denied
/Users/usrname/sage/src/bin/sage: line 334: exec: /Users/usrname/sage/src/bin/sage-ipython: cannot execute: Undefined error: 0
I get a different error using sudo.
usrname:~ usrname$ sudo sage
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's not owned by a trusted user.
Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: quit()
Exiting Sage (CPU time 0m0.19s, Wall time 3m1.92s).
I also tried it with sage in
/Applications/sage
Same problems.
and I also tried installing the Sage.app (in Applications), but this failed as well (Error 500, presumably for the same reasons as the above errors)
The permissions in my home folder install are
usrname (ME) read and write, staff Read only, everyone Read only
My /Applications folder additionally has (this motivated me to try it in the home folder)
system read and write
I have checked that I'm using the right sage install by using for my sage command
sudo ln -s ~/sage/sage /usr/local/bin/sage
and checking that I was not overriding this with something else in my path. Also,
usrname:sage usrname$ which sage
/usr/local/bin/sage
Thu, 19 Mar 2015 17:32:14 -0500http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/Comment by alejandroerickson for <p>I get an error like this one when I try to start sage.</p>
<pre><code>/sage: line 334: path/sage-ipython: Permission denied
</code></pre>
<p>It does start (with related errors), however, when I run </p>
<pre><code>$ sudo sage
</code></pre>
<p>I might need help providing the right details, but here goes:</p>
<pre><code> usrname$ sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
/Users/usrname/sage/src/bin/sage: line 334: /Users/usrname/sage/src/bin/sage-ipython: Permission denied
/Users/usrname/sage/src/bin/sage: line 334: exec: /Users/usrname/sage/src/bin/sage-ipython: cannot execute: Undefined error: 0
</code></pre>
<p>I get a different error using sudo.</p>
<pre><code>usrname:~ usrname$ sudo sage
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's not owned by a trusted user.
Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: quit()
Exiting Sage (CPU time 0m0.19s, Wall time 3m1.92s).
</code></pre>
<p>I also tried it with sage in</p>
<pre><code>/Applications/sage
</code></pre>
<p>Same problems.</p>
<p>and I also tried installing the Sage.app (in Applications), but this failed as well (Error 500, presumably for the same reasons as the above errors)</p>
<p>The permissions in my home folder install are </p>
<pre><code>usrname (ME) read and write, staff Read only, everyone Read only
</code></pre>
<p>My /Applications folder additionally has (this motivated me to try it in the home folder)</p>
<pre><code>system read and write
</code></pre>
<p>I have checked that I'm using the right sage install by using for my sage command</p>
<pre><code>sudo ln -s ~/sage/sage /usr/local/bin/sage
</code></pre>
<p>and checking that I was not overriding this with something else in my path. Also,</p>
<pre><code>usrname:sage usrname$ which sage
/usr/local/bin/sage
</code></pre>
http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?comment=26257#post-id-26257Reading related posts... does it matter that I did this:
sudo cp -r /Volumes/sage-6.5-x86_64-Darwin/sage ~/Thu, 19 Mar 2015 17:37:42 -0500http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?comment=26257#post-id-26257Answer by dowewas2 for <p>I get an error like this one when I try to start sage.</p>
<pre><code>/sage: line 334: path/sage-ipython: Permission denied
</code></pre>
<p>It does start (with related errors), however, when I run </p>
<pre><code>$ sudo sage
</code></pre>
<p>I might need help providing the right details, but here goes:</p>
<pre><code> usrname$ sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
/Users/usrname/sage/src/bin/sage: line 334: /Users/usrname/sage/src/bin/sage-ipython: Permission denied
/Users/usrname/sage/src/bin/sage: line 334: exec: /Users/usrname/sage/src/bin/sage-ipython: cannot execute: Undefined error: 0
</code></pre>
<p>I get a different error using sudo.</p>
<pre><code>usrname:~ usrname$ sudo sage
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's not owned by a trusted user.
Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: quit()
Exiting Sage (CPU time 0m0.19s, Wall time 3m1.92s).
</code></pre>
<p>I also tried it with sage in</p>
<pre><code>/Applications/sage
</code></pre>
<p>Same problems.</p>
<p>and I also tried installing the Sage.app (in Applications), but this failed as well (Error 500, presumably for the same reasons as the above errors)</p>
<p>The permissions in my home folder install are </p>
<pre><code>usrname (ME) read and write, staff Read only, everyone Read only
</code></pre>
<p>My /Applications folder additionally has (this motivated me to try it in the home folder)</p>
<pre><code>system read and write
</code></pre>
<p>I have checked that I'm using the right sage install by using for my sage command</p>
<pre><code>sudo ln -s ~/sage/sage /usr/local/bin/sage
</code></pre>
<p>and checking that I was not overriding this with something else in my path. Also,</p>
<pre><code>usrname:sage usrname$ which sage
/usr/local/bin/sage
</code></pre>
http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?answer=34827#post-id-34827Try creating a new folder and then running sage in it
sage
The error should no longer appear.Thu, 15 Sep 2016 07:13:28 -0500http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?answer=34827#post-id-34827Answer by tmonteil for <p>I get an error like this one when I try to start sage.</p>
<pre><code>/sage: line 334: path/sage-ipython: Permission denied
</code></pre>
<p>It does start (with related errors), however, when I run </p>
<pre><code>$ sudo sage
</code></pre>
<p>I might need help providing the right details, but here goes:</p>
<pre><code> usrname$ sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
/Users/usrname/sage/src/bin/sage: line 334: /Users/usrname/sage/src/bin/sage-ipython: Permission denied
/Users/usrname/sage/src/bin/sage: line 334: exec: /Users/usrname/sage/src/bin/sage-ipython: cannot execute: Undefined error: 0
</code></pre>
<p>I get a different error using sudo.</p>
<pre><code>usrname:~ usrname$ sudo sage
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's not owned by a trusted user.
Untrusted users could put files in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.5, Release Date: 2015-02-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: quit()
Exiting Sage (CPU time 0m0.19s, Wall time 3m1.92s).
</code></pre>
<p>I also tried it with sage in</p>
<pre><code>/Applications/sage
</code></pre>
<p>Same problems.</p>
<p>and I also tried installing the Sage.app (in Applications), but this failed as well (Error 500, presumably for the same reasons as the above errors)</p>
<p>The permissions in my home folder install are </p>
<pre><code>usrname (ME) read and write, staff Read only, everyone Read only
</code></pre>
<p>My /Applications folder additionally has (this motivated me to try it in the home folder)</p>
<pre><code>system read and write
</code></pre>
<p>I have checked that I'm using the right sage install by using for my sage command</p>
<pre><code>sudo ln -s ~/sage/sage /usr/local/bin/sage
</code></pre>
<p>and checking that I was not overriding this with something else in my path. Also,</p>
<pre><code>usrname:sage usrname$ which sage
/usr/local/bin/sage
</code></pre>
http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?answer=26258#post-id-26258It seems that you installed Sage as the `root` user, which is not the correct way. If you plan to launch the `sage` command from the `usrname` user, you can go into your Sage directory and type :
sudo chown -R usrname:usrname .
(don't forget the dot at the end). Then you can launch Sage as the user `usrname`:
./sage
Thu, 19 Mar 2015 18:11:51 -0500http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?answer=26258#post-id-26258Comment by alejandroerickson for <p>It seems that you installed Sage as the <code>root</code> user, which is not the correct way. If you plan to launch the <code>sage</code> command from the <code>usrname</code> user, you can go into your Sage directory and type :</p>
<pre><code>sudo chown -R usrname:usrname .
</code></pre>
<p>(don't forget the dot at the end). Then you can launch Sage as the user <code>usrname</code>:</p>
<pre><code>./sage
</code></pre>
http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?comment=26266#post-id-26266Thank you! What a silly pitfall :(. I did it by reinstalling without sudo, but this would be faster.Fri, 20 Mar 2015 05:29:14 -0500http://ask.sagemath.org/question/26256/sage-line-334-pathsage-ipython-permission-denied/?comment=26266#post-id-26266