[Paraview] Python shell, os.environ

Heiland, Randy heiland at iu.edu
Tue Feb 13 20:49:48 EST 2018


To follow up on this thread…

On OS X, running PV as an app, then opening the Python shell, I get:
>>> os.environ
{'SHELL': '/bin/bash', 'SSH_AUTH_SOCK': '/private/tmp/com.apple.launchd.yYfqa8v89A/Listeners', 'XPC_FLAGS': '0x0', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'Apple_PubSub_Socket_Render': '/private/tmp/com.apple.launchd.dl97FcplnG/Render', 'LOGNAME': 'heiland', 'USER': 'heiland', 'XPC_SERVICE_NAME': 'org.paraview.ParaView.37836', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'HOME': '/Users/heiland', 'DISPLAY': '/private/tmp/com.apple.launchd.Xf3Uaw6FhP/org.macosforge.xquartz:0', 'TMPDIR': '/var/folders/l6/s467rzgs75n91gdbkn7vr0f40000gn/T/'}
>>>

however, running it as:
/Applications/ParaView-5.4.1.app/Contents/MacOS$ ./paraview 
…
the os.environ spews ALL envs in my bash shell.


If there’s another option, outside of using env vars, for dynamically getting a user-defined string inside a Programmable Source, I’d welcome it.

-Randy

 
> On Dec 21, 2017, at 3:31 PM, Ben Boeckel <ben.boeckel at kitware.com> wrote:
> 
> On Thu, Dec 21, 2017 at 15:14:01 +0000, Heiland, Randy wrote:
>> Thanks Ben.  You’re right, of course. Moreover, my idea for having
>> (non-admin) users install additional Python modules (e.g., scipy) into
>> PV’s dir, is a not going to go well.
> 
> Well, if `sys.path` or `PYTHONPATH` can be pointed to it, it *should*
> work (though the `numpy` in the package may not be configured properly
> for `scipy`).
> 
>> Do we at least agree that if I ask users to start PV from the
>> Terminal, PV’s Python will then pick up the user’s env vars?
> 
> It should, but ParaView doesn't do anything to stop it. If it doesn't
> work, it's probably some Apple framework thing that needs to be told not
> to do silly things.
> 
> --Ben



More information about the ParaView mailing list