批量安装python3 requirements并指定参数 假设有requirements.txt如下: ```shell Django==2.2.7 gunicorn==19.9.0 Markdown==3.1.1 Pygments==2.4.2 pytz==2019.3 redis==3.3.11 setuptools==41.4.0 sqlparse==0.3.0 wheel==0.33.6 captcha==0.4 django-redis==5.2.0 Pillow==9.4.0 ``` 如果想在批量pip安装的时候指定参数,如使用镜像源(如mirrors.tencent.com)进行加速。 可行的方法是拼凑linux命令: ```shell cat requirements.txt | xargs -n 1 -L 1 pip3 install --extra-index-url https://mirrors.tencent.com/repository/pypi/tencent_pypi/simple -i https://mirrors.cloud.tencent.com/pypi/simple ``` 来自 大脸猪 写于 2024-11-28 14:49 -- 更新于2024-11-28 14:52 -- 0 条评论