"PermissionError" thrown when typing "exit()" to leave the Python interpreter
<p>When I enter the python interpreter as a regular user with <code>python</code>. I see this:</p>

<pre><code>Python 3.5.2 |Anaconda 4.1.1 (64-bit)| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
</code></pre>

<p>I can immediately type <code>exit()</code> and this happens:</p>

<pre><code>&gt;&gt;&gt; exit()
Error in atexit._run_exitfuncs:
PermissionError: [Errno 13] Permission denied
</code></pre>

<p>I think it may be related to the fact that running <code>sudo python3</code> gives: </p>

<pre><code>Python 3.5.2 (default, Jul  5 2016, 12:43:10) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information. 
&gt;&gt;&gt; 
</code></pre>

<p>This looks to be a different python 3.5 install.</p>

<p>If this is the issue I would like to have my anaconda python install run when I type <code>sudo python3</code>. How do I do this?</p>

<p>Having googled the error message, I found this issue: <a href="http://bugs.python.org/issue19891" rel="nofollow">http://bugs.python.org/issue19891</a></p>

<p>It seems that the problem often has to do with the current user not having a home directory (which I think is logical for a user called python) or not having the proper permissions on their home directory, but the issue is still open.</p>

python ubuntu anaconda sudo