How to "pip install" inside shell?

Viewed 38

I forgot to $ pip install sh before starting ipython, but I feel the urge to import bash commands from sh

>>> from sh import tree
ModuleNotFoundError: No module named 'sh

If I've just started then I can leave ipython and ask bash

$ python3 -m pip install sh

And carry on

>>> from sh import tree
>>> tree -d

But, if I have a lot of history inside ipython that I don't want to throw away, then how do I ask my current python interpreter to pip install a package?

0 Answers
Related