You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to set the IPython profile with an environment variable, i.e. something like
$ IPYTHON_PROFILE=testing ipython
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.7.0 -- An enhanced Interactive Python. Type '?' for help.
IPython profile: testing
In [1]:
My particular use case is to use the conda {de,}activate.d/ hooks to change profiles based on which conda environment is active. At the moment, an easy hack is to alias ipython to ipython --profile={profile} and then unalias in deactivate, but environment variables would be cleaner.
The text was updated successfully, but these errors were encountered:
Sorry to bump this issue, but for anyone who has a similar problem, I think there is a clean solution without an additional environment variable.
IPython automatically loads the default profile in the $IPYTHONDIR path if it exists. So for a certain environment env, one could create a directory, e.g. $HOME/.ipython/env , and initialize the default profile in there via ipython profile create default --ipython-dir $HOME/.ipython/env. There should now be $HOME/.ipython/env/profile_default, where you can customize your IPython settings.
On activation of the environment, you just have to set the environment variable $IPYTHONDIR to $HOME/.ipython/env (this can be automated in conda) and every IPython process started from now on will automatically select the default profile therein.
It would be nice to set the IPython profile with an environment variable, i.e. something like
My particular use case is to use the conda {de,}activate.d/ hooks to change profiles based on which conda environment is active. At the moment, an easy hack is to alias
ipython
toipython --profile={profile}
and then unalias in deactivate, but environment variables would be cleaner.The text was updated successfully, but these errors were encountered: