skip to navigation
skip to content

pypath_magic 0.2.1

Python magic to manipulate the Python path

Latest Version: 0.3.1

Quick-start article

pypath-magic adds an IPython magic (err… Jupyter magic?) command for easily manipulating your Python path. To use the magic command, just load the extension from an IPython session:

In [1]: %load_ext pypath_magic

After loading, you will have access to the %pypath magic. You can type:

In [2]: %pypath

to list all the custom paths added by pypath-magic. When you get started, you won’t have anything there. To add some custom paths, just change to a directory and call %pypath -a:

In [3]: %cd path/to/my-repo

In [4]: ls

In [5]: %pypath -a
Added u'/absolute/path/to/my-repo' to path.

In [6]: %pypath

Now you can reuse those helper functions:

In [7]: from plot_helpers import plot_slope_marker

Changes to your python path will persist across IPython sessions, and those paths will be available outside of IPython. If you later want to delete a directory from your path, just use %pypath -d:

In [8]: %cd path/to/my-repo

In [9]: %pypath -d
Deleted u'/absolute/path/to/my-repo' from path.

You can also list your entire python path with %pypath -l:

In [10]: %pypath -l


For additional usage information, type:

In [11]: %pypath?


To install using pip:

$ pip install git+

To install from source:

$ git clone
$ cd pypath-magic
$ python install

If you get an error like:

error: invalid command 'egg_info'

you probably need to update setuptools:

pip install --upgrade setuptools


  • Python 2.7/3.4 (older versions probably work, but this is not tested)
  • IPython >= 1.1
  • setuptools >= 0.7


New BSD (a.k.a. Modified BSD). See LICENSE file in this directory for details.

File Type Py Version Uploaded on Size
pypath_magic-0.2.1.tar.gz (md5) Source 2014-08-06 4KB
  • Downloads (All Versions):
  • 8 downloads in the last day
  • 110 downloads in the last week
  • 527 downloads in the last month