Pants will load a [REPL](🔗) with all of your specified source code and any of its third-party dependencies, which allows you to import those values.
In addition to the default Python shell, Pants supports the improved [IPython shell](🔗).
To use IPython, run `
./pants repl --shell=ipython`. To permanently use IPython, add this to your `
You can change IPython's version with `
If you set the `
version` lower than IPython 7, then you must set `
ignore_cwd = false` in the `
[ipython]` section to avoid Pants setting an option that did not exist in earlier IPython releases.
IPython does not yet work with Pantsd
When using IPython, use the option `
--no-pantsd` to turn off the Pants daemon, e.g. `
./pants --no-pantsd repl --shell=ipython`. We are working to [fix this](🔗).
Python 2 support
Pants uses IPython 7 by default, which does not work with Python 2. You can override `
version` to use IPython 5. As mentioned above, you must set `
ignore_cwd = false`.
You can even use IPython 7 for Python 3 code, and IPython 5 for Python 2 code:
This will not load any of your code:
./pants repl ::` will load all your code.
Tip: how to exit the REPL
Either type `
exit()` and hit enter, or press `