简体   繁体   English

使用Pip和Anaconda安装包(Windows)

[英]Installing packs with Pip and Anaconda (Windows)

Good evening! 晚上好! I was wondering why you have to use a shell, such as cmd, to install packs in Pip but when it comes to Anaconda you can use its own shell. 我想知道为什么你必须使用一个shell(如cmd)在Pip中安装包,但是当涉及到Anaconda时,你可以使用它自己的shell。 Or, rephrasing: what impedes Pip to be considered a shell (considering it even has the appearance of one if you open it by itself)? 或者,改写:什么阻碍了Pip被认为是一个shell(考虑到它甚至有一个外观,如果你自己打开它)? Thank you! 谢谢!

A shell is a command line interface that lets you give your computer commands using a syntax specific to the OS and shell program. shell是一个命令行界面,允许您使用特定于OS和shell程序的语法为计算机命令。 PIP (acronym for "PIP Installs Packages") is simply a program designed to be used within a shell environment like CMD. PIP(“PIP Installs Packages”的首字母缩写词)只是一个程序,旨在用于像CMD这样的shell环境中。

Anaconda is a Python package distribution which happens to include a Python IDLE, which has a both a command line interface as well as text editor. Anaconda是一个Python包发行版,恰好包含一个Python IDLE,它既有命令行界面,也有文本编辑器。

Hope this helps your understanding. 希望这有助于您的理解。

Pip is actually running from the shell when double clicking! 当双击时,Pip实际上是从shell运行的! When you double click pip you will probably see that it quickly closes. 当您双击点击时,您可能会看到它很快关闭。 The inplamenters chose to this. 投影者选择了这一点。 Not exactly sure why (you would have to ask them) but I would guess because of one (or more) of these reasons: 不完全确定原因(你必须问他们)但我猜是因为其中一个(或多个)原因:

1) Running from a shell is more portable. 1)从shell运行更便携。 No matter where you are you in your file path you can open up cmd and as long as pip has been added to path run it. 无论你在文件路径中的哪个位置,都可以打开cmd,只要将pip添加到路径运行它。 Running by double clicking is not always convenient. 双击运行并不总是方便。

2) Other architectures. 2)其他架构。 Under Linux the terminal has a much greater part than on Windows. 在Linux下,终端比Windows更重要。 The inplamenters would have wanted pip to be cross platform. inplamenters本来希望pip是跨平台的。 The double click method does not exist under Linux and so the only other option is to run through the terminal. Linux下不存在双击方法,因此唯一的另一种选择是通过终端运行。 Remember that the inplamenters wanted to be as cross platform as possible and running from a shell is the safest, most concise method of doing things. 请记住,inplamenters希望尽可能地跨平台,从shell运行是最安全,最简洁的做事方法。

3) They did not have only Windows in mind when building. 3)他们在建造时并没有考虑到Windows。 Python was built under C and although cross platform it has not been built for a single OS. Python是在C下构建的,虽然它是跨平台的,但它并不是为单个操作系统构建的。 This means the inplamenters could not use all the attractive features because many would not work as soon as the OS changed. 这意味着inplamenters无法使用所有有吸引力的功能,因为许多操作系统一改变就无法工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM