如何使用pip一次安装多个python软件包 [英] How to install multiple python packages at once using pip

查看:170
本文介绍了如何使用pip一次安装多个python软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一种简单的方法,但是我在这里和Google上都找不到. 所以我很好奇是否有办法使用pip安装多个软件包. 像这样:

I know it's an easy way of doing it but i didn't find it neither here nor on google. So i was curious if there is a way to install multiple packages using pip. Something like:

pip install progra1 , progra2 ,progra3 ,progra4 . 

或:

pip install (command to read some txt containing the name of the modules) 

推荐答案

要在命令行上安装多个软件包,只需将它们作为空格分隔的列表传递即可,例如:

For installing multiple packages on the command line, just pass them as a space-delimited list, e.g.:

pip install wsgiref boto

然后从pip install --help从文本文件安装:

For installing from a text file, then, from pip install --help:

-r FILENAME,-requirement = FILENAME

-r FILENAME, --requirement=FILENAME

安装给定需求文件中列出的所有软件包.此选项可以多次使用.

Install all the packages listed in the given requirements file. This option can be used multiple times.

看看有关需求文件的pip文档有关它们的一般布局和语法-请注意,如果需要快速的示例,则可以使用pip freeze根据当前环境/站点软件包生成一个-例如(基于已在干净的virtualenv中安装了wsgirefboto):

Take a look at the pip documentation regarding requirements files for their general layout and syntax - note that you can generate one based on current environment / site-packages with pip freeze if you want a quick example - e.g. (based on having installed wsgiref and boto in a clean virtualenv):

$ pip freeze
boto==2.3.0
wsgiref==0.1.2

这篇关于如何使用pip一次安装多个python软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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