IPython - Command Line Options

In this chapter, let us understand how to work with various command line options in IPython.

Invoking IPython Program

You can invoke an IPython program using the following options −

C:\python36> ipython [subcommand] [options] [-c cmd | -m mod | file] [--] [arg]

The file option is a Python script with .py extension. If no other option is given, the script is executed and command prompt reappears.

C:\python36>ipython hello.py
Hello IPython
welcome to interactive computing

Subcommands and Parameters

An IPython command accepts the following subcommand options −

  • Profile − Create and manage IPython profiles.

  • Kernel − Start a kernel without an attached frontend.

  • Locate − Print the path to the IPython dir.

  • History − Manage the IPython history database.

An IPython profile subcommand accepts the following parameters −

  • ipython profile create myprofile − Creates a new profile.

  • ipython profile list − Lists all available profiles.

  • ipython locate profile myprofile − Locates required profile.

To install new IPython kernel, use the following command −

Ipython kernel –install –name

To print the path to the IPython dir, use the following command −

C:\python36>ipython locate myprofile

Besides, we know that −

  • The history subcommand manages IPython history database.

  • The trim option reduces the IPython history database to the last 1000 entries.

  • The clear option deletes all entries.

Some of the other important command line options of IPython are listed below −

Sr.No. IPython Command & Description


Turn on the auto calling of magic commands.



Enable auto calling the pdb debugger after every exception.



Pre-load matplotlib and numpy for interactive use with the default matplotlib backend.



Configure matplotlib for interactive use with the default matplotlib backend.



Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk2','gtk3', 'osx', 'pyglet', 'qt', 'qt4', 'qt5', 'tk', 'wx', 'gtk2', 'qt4').

The sample usage of some of the IPython command line options are shown in following table −

Sr.No. IPython Command & Description

ipython --matplotlib

enable matplotlib integration


ipython --matplotlib=qt

enable matplotlib integration with qt4 backend


ipython --profile=myprofile

start with profile foo


ipython profile create myprofile

create profile foo w/ default config files


ipython help profile

show the help for the profile subcmd


ipython locate

print the path to the IPython directory


ipython locate profile myprofile

print the path to the directory for profile `myprofile`

Kickstart Your Career

Get certified by completing the course

Get Started