Again, I'm not sure about OSX.  Try adding this line to your /etc/sudoers file:

Defaults env_keep += PYTHONPATH

WARNING! I make no claims to the security of this edit of your sudoers
file.  If you have multiple users setup with different sudo
permissions, this may be a bad idea :)

-John

On Mon, Jun 7, 2010 at 9:32 AM, Matthew Gardner <[email protected]> wrote:
> On Mon, Jun 7, 2010 at 9:26 AM, John Shaver <[email protected]> wrote:
>>
>> If you run:
>>
>> sudo sudo -V
>>
>> It should tell you your sudo settings.  Including a list of all
>> environment variables not passed to sudo.  This will usually include
>> PYTHONPATH.  You should be able to work around it with:
>>
>> sudo env PYTHONPATH=$PYTHONPATH command_to_run
>>
>> At least, that worked for me in ubuntu.  Don't know about macosx :)
>
> This worked for me, though I didn't see PYTHONPATH in the list from sudo
> sudo -V.  Thanks for the help.  It would be nice to get a permanent fix,
> though, so I don't have to use this command every time I do sudo python.
>>
>>
>
> --------------------
> BYU Unix Users Group
> http://uug.byu.edu/
>
> The opinions expressed in this message are the responsibility of their
> author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
> ___________________________________________________________________
> List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list
>
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to