It is possible to make persistent changes to settings for default settings on Windows 7? I would like to change font-size and shell size.
-
2Yes, there are config files: http://ipython.org/ipython-doc/stable/interactive/tutorial.html#configuration – Thomas K Mar 28 '12 at 12:28
-
Thanks. I managed to change font size and family which resulted in a slightly larger window. – John Mar 28 '12 at 23:00
-
https://stackoverflow.com/questions/37036520/setting-default-configuration-for-jupyter-qtconsole – sancho.s ReinstateMonicaCellio Jul 04 '20 at 10:38
7 Answers
Instructions on configuring the ipython command line application are here on IPython's web site. Step-by-step instructions for configuring the font size in particular:
First, create the IPython profile. Simply running IPython or IPython's QtConsole should do this for you, but if you have to do it by hand, run
ipython profile create
Second, create an IPython config file:
- Windows -
%USERPROFILE%\.ipython\profile_default\ipython_config.py
- Linux or OS X -
~/.ipython/profile_default/ipython_config.py
Sample IPython contents:
c = get_config()
c.IPythonWidget.font_size = 11
c.IPythonWidget.font_family = 'Consolas'
There's a more detailed sample config file at ipython.org.

- 56,064
- 19
- 146
- 246
-
1That last link is now broken, I think http://ipython.org/ipython-doc/stable/config/index.html is the updated equivalent. – schodge Mar 16 '14 at 23:05
-
@schodge - Updated. Thanks! (In the future, feel free to propose an edit yourself, instead of just adding a comment.) – Josh Kelley Mar 17 '14 at 02:36
-
-
@AvinashRaj - Works for me, so I don't know what's wrong. If you're still having problems, a separate question, with more detail, would be easier than discussing via comments. – Josh Kelley Feb 05 '15 at 13:37
-
schodge's updated link works. Also, for the intro guide: https://ipython.org/ipython-doc/stable/config/intro.html – Jacob Irwin Dec 13 '15 at 04:31
-
1If you want to change the size of initial window, use `c.IPythonWidget.height = 36`, `c.IPythonWidget.width = 96` (value refers to the number of rows or columns). – oracleyue Jun 23 '16 at 16:00
-
Your post describes how to configure IPython. The OP wants to know how to configure the jupyter qtconsole. When I make changes to my ipython_config.py file, they are not recognized by the console opened with `%qtconsole` in jupyter. What am I missing here? Thanks! – timgeb Jan 28 '20 at 13:08
The QtConsole has configurable via the ConsoleWidget. Start with:
> ipython qtconsole --ConsoleWidget.font_size=11
-
2But these are not persistent changes, unlike the answer of [Josh](http://stackoverflow.com/a/18904744/2521769) – Stefan van den Akker Jan 25 '14 at 13:32
With the most recent versions of IPython/Jupyter:
The relevant config file is now
~/.jupyter/jupyter_qtconsole_config.py
At the top of the file we do
c = get_config()
The relevant command for font size is
c.ConsoleWidget.font_size = 12
Another setting is
c.JupyterWidget.syntax_style = "trac"
(for example), which is a colour-scheme setting. List of schemes. It is possible to create a custom scheme: the easiest way seems to be to put ayour_name_here.py
into the$PYTHON/Lib/site-packages/pygments/styles
directory, of a similar format to the other files there. (Configuring things this way sounds a bit fragile, but the other suggested way, of registering the custom scheme, seems similarly fragile.) More styles may be specified using CSS. In the config file as above:c.JupyterQtConsoleApp.stylesheet = '/path/to/your_name_here.css'
An example "LightBG" stylesheet is given here. (There are only a few CSS classes. Some of the default highlighting still stays as default, with no way to change them using either the CSS or the Pygments style file. For example, the highlighting of a
SyntaxError
message stays at the default. This might have been fixed in the most recent version — see the discussion here.)
Here's a bonus. A shortcut for changing IPython qtconsole settings using one function call.
Put the following code into a file named IPYTHON_PROFILE_DIR/startup/startup.ipy
. (For some reason this is still under ~/.ipython
, not ~/.jupyter
.) It can be named something other than "startup.ipy
", but the extension must be .ipy
, not .py
.
def edit_config():
profile_path = !ipython locate profile
!{'gvim "%s/ipython_config.py"' % profile_path[0]}
(Replace "gvim
" with your preferred editor.)
Now, whenever you need to tweak your Jupyter Qtconsole configuration, you'll be able to bring it up using:
In [1]: edit_config()

- 22,495
- 17
- 107
- 124
-
The actual line I use is: `!{'gvim -p "{0}/ipython_config.py" "{0}/../../.jupyter/jupyter_qtconsole_config.py" '.format(profile_path[0])}` This is to open both config files in tabs. – Evgeni Sergeev Sep 08 '16 at 12:06
-
When launching "qtconsole" with the the most recent version of Anaconda Navigator, the `c = get_config()` seems to "hang" launching of the console. Removing that and just using the variable `c` as above works just fine. – Dave C Nov 27 '17 at 15:21
Did you change the config files? http://ipython.org/ipython-doc/stable/api/generated/IPython.config.loader.html#IPython.config.loader.Config

- 157
- 1
- 8
Step by step, one would do like this:
In bash under Windows 7 (MingW), I would get help straight from IPython with
/c/Python27/Scripts/IPython.exe qtconsole --help-all | grep font2.
Then you just have to edit ipython_config.py (which is located in your .ipython home directory. In Windows 7: /c/Users/< your_user >/.ipython/profile_default/ipython_config.py
c.IPythonWidget.font_size = 11
c.IPythonWidget.font_family = 'Calibri'
For the window size, look at this issue. You may need to install a recent version.

- 15,088
- 18
- 77
- 106
you can right click on the ipython windows and select "Default". you can set your default configuration from there.

- 11
- 1
Works for linux:
Use https://bitbucket.org/joon/color-schemes-for-ipython-qt-console
pip install jupyter_qtconsole_colorschemes
In ~/.jupyter/jupyter_qtconsole_config.py
,
you can further configure other settings mentioned here(https://jupyter.org/qtconsole/stable/config_options.html):
Example:
color_theme = 'monokai' # specify color theme
import pkg_resources
c.JupyterQtConsoleApp.stylesheet = pkg_resources.resource_filename(
"jupyter_qtconsole_colorschemes", "{}.css".format(color_theme))
c.JupyterWidget.syntax_style = color_theme
c.ConsoleWidget.font_size=15

- 9,404
- 26
- 87
- 142
-
1For me, setting `c.JupyterWidget.syntax_style` alone worked. But when also setting `c.JupyterQtConsoleApp.stylesheet`, it did not work. – sancho.s ReinstateMonicaCellio Jul 04 '20 at 11:54