How to install a Python package from within IPython?

后端 未结 5 1274
遥遥无期
遥遥无期 2020-11-27 14:01

I wonder if it\'s possible to install python packages without leaving the IPython shell.

5条回答
  •  天涯浪人
    2020-11-27 14:40

    You can use the ! prefix like this:

    !pip install packagename
    

    The ! prefix is a short-hand for the %sc command to run a shell command.

    You can also use the !! prefix which is a short-hand for the %sx command to execute a shell command and capture its output (saved into the _ variable by default).

提交回复
热议问题