Why does pip need an exclamation point to use in iPython?

梦想与她 提交于 2020-03-14 15:58:21

问题


Just a quick example, typing pip list doesn't work but !pip list does. Is there some syntax regarding the exclamation point and using modules in the ipython shell?


回答1:


This is actually not specific to pip, but really any shell assignment from the iPython notebook. You'll notice other shell commands also work (from the docs):

In[1]: !pwd
/User/home/

Change directory:

In[1]: !cd /var/etc

This is simply shorthand that the good folks at Jupyter have included. See Shell Assignment in the docs for more of an explanation.



来源:https://stackoverflow.com/questions/41510454/why-does-pip-need-an-exclamation-point-to-use-in-ipython

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!