有没有一种方法可以使用pip一次安装所有python模块? [英] Is there a way to install all python modules at once using pip?

查看:110
本文介绍了有没有一种方法可以使用pip一次安装所有python模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用一个pip命令为Python 2.7.12安装所有可用的模块.有没有一种方法而不必指定每个软件包的名称?

I would like to install all available modules for Python 2.7.12 using a single pip command. Is there a way to do this without having to specify every single package name?

推荐答案

我强烈建议您不要这样做-压倒性的最佳实践是使用requirements.txt文件,列出要具体安装的软件包.

I highly recommend against doing this - the overwhelmingly supported best practice is to use a requirements.txt file, listing the packages you want to install specifically.

然后使用pip install -r requirements.txt安装它,并为您的项目安装所有软件包.

You then install it with pip install -r requirements.txt and it installs all the packages for your project.

这有几个好处:

  • 通过仅安装必需的软件包来实现可重复性
  • 简洁

但是,如果您确实要安装所有python软件包(请注意有成千上万个),则可以通过以下方式进行安装:

However, if you really do want to install ALL python packages (note that there are thousands), you can do so via the following:

点子搜索* | grep)[[:: space:]]" |切-f1 -d"

pip search * | grep ")[[:space:]]" | cut -f1 -d" "

我强烈建议您不要这样做,因为它可能会对您的系统造成可怕的影响,因为它会尝试安装每个python软件包(以及为什么将其安装在剧透标签中).

I strongly recommend against this as it's likely to do horrible things to your system, as it will attempt to install every python package (and why it's in spoiler tags).

这篇关于有没有一种方法可以使用pip一次安装所有python模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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