![](/img/trans.png)
[英]In the conda environment.yml file, how do I append to existing variables without overriding them?
[英]How do I pip install packages in a conda environment.yml file?
運行以下代碼時出現以下錯誤:
name: myapp-env
dependencies:
- python=3.5
- pip
- django=1.8
- pip:
- django-environ=0.4
錯誤:
yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
in "<string>", line 7, column 1:
- django-environ=0.4
將.yml文件格式化為pip安裝包的正確方法是什么?
它在那里非常明確:YAML(在pyyaml中實現)禁止使用制表符來縮進。 將該行更改為<space><space><space><space>- django-environ=0.4
。
我注意到了我的問題。 我使用的是Sublime文本,而Indentation設置為Tab。 我選擇Convert Indentation to Spaces
並且它有效。
此外,.yml文件應如下所示(兩個==用於pip包版本)。
name: myapp-env
dependencies:
- python=3.5
- pip
- django=1.8
- pip:
- django-environ==0.4
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.