[IPython-User] need to sudo prior to running

Paul Ivanov pivanov314@gmail....
Wed Dec 22 15:52:23 CST 2010


Akhil Shah, on 2010-11-19 18:31,  wrote:
> Hi,
> I have installed IPython on OSX 10.6 but can only run it via 'sudo ipython'.
>  Invoking 'ipython' without sudo leads to the following error:
> Traceback (most recent call last):
>   File "/usr/local/bin/ipython", line 5, in <module>
>     from pkg_resources import load_entry_point
>   File
> "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
> line 2603, in <module>
> 
>   File
> "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
> line 666, in require
> 
>   File
> "/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py",
> line 565, in resolve
> 
> Does anyone know what causes this and how to fix it?
> 
> I have a similar problem when I import pylab into my python scripts.  The
> script will run if I 'sudo' but spits out the following error otherwise:
>   from pylab import *
>   File
> "/Library/Python/2.6/site-packages/matplotlib-1.0.0-py2.6-macosx-10.6-universal.egg/pylab.py",
> line 1, in <module>
>     from matplotlib.pylab import *
- snip -
>     raise RuntimeError("'%s' is not a writable dir; you must set
> %s/.matplotlib to be a writable dir.  You can also set environment variable
> MPLCONFIGDIR to any writable directory where you want matplotlib data stored
> "% (h, h))
> RuntimeError: '/Users/ashah' is not a writable dir; you must set
> /Users/ashah/.matplotlib to be a writable dir.  You can also set environment
> variable MPLCONFIGDIR to any writable directory where you want matplotlib
> data stored

Hi Akhil,

You sent this to the list a while back, but no one seemed to
reply, so I thought I'd take a stab at it.

I'm not sure about the first problem you mentioned, but the
second one I think I can shed some light on. You would get this
if /Users/ashah/.matplotlib is owned by root, your IPython error
may also be related to this. The output of

  $ ls -al ~/ | grep matplotlib

should be something like:

drwxr-xr-x   3 ashah   ashah       4096 2010-12-20 17:58 .matplotlib/

not:

drwxr-xr-x   3 root   root       4096 2010-12-20 17:58 .matplotlib/

you can use something like this command to fix the above
  $ chown ashah:ashah ~/.matplotlib

best,
-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://mail.scipy.org/pipermail/ipython-user/attachments/20101222/8d67eb99/attachment.bin 


More information about the IPython-User mailing list