Accessing environment variables from QtConsole or Canopy

Setting GUI-accessible environment variables in OSX is non-trivial, and environment variables set in standard places (like in your .bash_profile file) are not always available. The recommended process for setting them is described here: http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x

However, IPython provides startup file capabilities, described here: http://ipython.org/ipython-doc/stable/config/overview.html#startup-files . Typically you would put these here: ~/.ipython/profile_default/startup/ . When testing, don't be alarmed that any print statements in your startup files don't show. This is also true in a lone qtconsole.

For Canopy, as another (less environmentally invasive but less convenient) alternative, you can start Canopy from terminal and it will inherit the shell's environment (e.g. from .bash_profile). Unfortunately, Canopy will not then act like a normal GUI app, at least in its current beta version (dock, icons, etc).

Have more questions? Submit a request

Comments

Powered by Zendesk