Python中文
首页
教程
问答
标签
搜索
登录
注册
Bash脚本到Conda Install requirements.txt,附带PIP跟踪
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>在linux服务器上安装Django应用程序的requirements.txt文件时,我可以运行:</p> <pre><code>conda install --yes --file requirements.txt </code></pre> <p>如果Conda(<code>PackageNotFoundError</code>)中没有任何包可用,则此操作将崩溃。这个bash one行是一个很酷的方式,一次一行地浏览requirements.txt文件<a href="https://gist.github.com/luiscape/19d2d73a8c7b59411a2fb73a697f5ed4" rel="noreferrer">source</a>:</p> <pre><code>while read requirement; do conda install --yes $requirement; done < requirements.txt </code></pre> <p>这将安装通过Conda可用的所有软件包,而不会在第一个丢失的软件包上崩溃。但是,我希望通过捕获Conda的输出来跟踪失败的包,如果存在<code>PackageNotFoundError</code>,则在包上运行pip install。</p> <p>我对bash不太在行,所以希望有人能提出一个建议。另一个解决方案可能是编写一个名为<code>pip-requirements.txt</code>的新文本文件,其中包含失败的需求。</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>将stderr重定向到文件:</p> <pre><code>while read requirement; do conda install --yes $requirement; done < requirements.txt 2>error.log </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
无法使用Django restfram生成PDF
9 回答
无法使用Django Rest框架发送压缩的gzip数据
7 回答
无法使用Django rest框架进行身份验证(请求用户=匿名用户)
10 回答
无法使用Django、Python和JavaScrip触发onclick函数
3 回答
无法使用Django.views.generic.View保存表单
5 回答
无法使用Django(python 2.7,OS X 10.11.1)
1 回答
无法使用Django/mongoengine连接到MongoDB(身份验证失败)
6 回答
无法使用Django\u mssql\u后端迁移到外部hos
3 回答
无法使用Django&Python3.4连接到MySql
9 回答
无法使用Django+nginx上载媒体文件
2 回答
无法使用Django1.6导入名称模式
6 回答
无法使用Django1.7和mongodb登录管理站点
8 回答
无法使用Djangoadmin创建项目,进程使用了错误的路径,因为我事先安装了错误的Python
6 回答
无法使用Djangockedi验证CBV中的字段
2 回答
无法使用Djangocketditor上载图像(错误400)
2 回答
无法使用Djangocron进行函数调用
6 回答
无法使用Djangofiler djang上载文件
3 回答
无法使用Djangokronos
3 回答
无法使用Djangomssql provid
8 回答
无法使用Djangomssql连接到带有Django 1.11的MS SQL Server 2016
10 回答