I am used to the R functionality of installing packages and I am trying to do the same thing with ipython
. Sometimes the following method works but then again somet
actually there is a much much much more elegant solution. when pip is installed then within python you can do things like this as well:
import pip
def install(package):
pip.main(['install', package])
install('requests')
which is easier. once logged into a virtualenv you can just make sure that you have what you need in the session you are in. easy.
Another alternative would be to use the %%bash
magic.
%%bash
pip install requests
If you want the standard output, one could even use the exclamation bang.
! pip install requests