如何并行安装/编译 pip 要求(make -j 等效) [英] How to install/compile pip requirements in parallel (make -j equivalent)

查看:64
本文介绍了如何并行安装/编译 pip 要求(make -j 等效)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 pip 需求中有很多包要安装,我想并行处理它们.

I have a lot of packages to install in my pip requirement and I'd like to process them in parallell.

我知道,例如,如果我想要 maken 个并行作业,我必须编写 make -j n;是否有满足 pip 要求的等效命令?

I know that, for example, that if I want n parallel jobs from make I have to write make -j n; is there an equivalent command for pip requirements?

谢谢!

推荐答案

有时 pip 使用 make 来构建依赖项.如果在它开始之前你设置 MAKEFLAGS 像:

Sometimes pip uses make to build dependencies. If before it starts you set MAKEFLAGS like:

export MAKEFLAGS="-j$(nproc)"
pip install -r requirements.txt

这可能有助于构建本机依赖项.

This may help building native dependencies.

注意:nproc 解析为系统中的 CPU 数量.

Note: nproc resovles as the number of CPUs in your system.

这篇关于如何并行安装/编译 pip 要求(make -j 等效)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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