How to run ipython from venv?

My ipython works okay, but when I try to open ipython console from venv I am getting:

Traceback (most recent call last):
  File "/usr/bin/ipython3", line 4, in <module>
    from IPython import start_ipython
ImportError: No module named 'IPython'

Any ways to do this?


Did you by any chance create the venv with the --system-site-packages flag and install ipython with pip? This combination is broken in my experience (Python 3.6.2, pip 9.0.1).

Two workarounds are:

  1. Use virtualenv instead of venv,
  2. Or use easy_install instead of pip.

With pip, scripts get the wrong shebang pointing to system python.