Issue
I have ipyhon installed in my CentOS6. When I launch ipython without sudo, it works fine. However, one of my python code is writing a new text file. When I do
%run writeText.py
PremissionError: [Errno 13] Permission denied: 'log.txt'
I tried to start ipython with sudo but it did not allow me
sudo ipython
sudo: unable to execute /usr/bin/ipython: No such file or directory
which I have double checked ipython is in that directory
Solution
To run sudo command in ipython, I found out I do not necessary need to run ipython with "sudo". Instead, I run ipython and use the magic word "!" to run linux command with sudo access:
%ipython
%!sudo lspci
%!sudo ...some command
Answered By - Allen W
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.