为什么 pip 需要一个感叹号才能在 iPython 中使用? [英] Why does pip need an exclamation point to use in iPython?

查看:48
本文介绍了为什么 pip 需要一个感叹号才能在 iPython 中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

举个简单的例子,输入 pip list 不起作用,但 !pip list 起作用.是否有一些关于感叹号和在 ipython shell 中使用模块的语法?

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?

推荐答案

这实际上并非特定于 pip,而是来自 iPython notebook 的任何 shell 命令.您会注意到其他 shell 命令也有效(来自文档):

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

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

更改目录:

In[1]: !cd /var/etc

这只是 Jupyter 的好人所包含的简写.请参阅文档中的 Shell Assignment更多的解释.

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

这篇关于为什么 pip 需要一个感叹号才能在 iPython 中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆