[英]Installing Python Package Based on OS
對於我的environment.yml
文件,我有一個依賴項列表。 一個軟件包僅在基於Windows
的系統上可用,但在該環境中則需要該軟件包。 其他軟件包可以安裝在任何操作系統上。
如何創建environment.yml,使其僅在Windows OS上安裝軟件包?
當前environment.yml
name: python_dev_env
channels:
- defaults
- anaconda
- conda-forge
- dhirschfeld
dependencies:
- pandas >=0.23
- pip
- python >=3.6
- nbconvert
- beautifulsoup4
- requests
- requests-kerberos==0.11.0
- requests-toolbelt
- requests_ntlm
- requests-oauthlib
- requests-negotiate-sspi
- jupyterlab
- pytest
- matplotlib
- scikit-learn
- scikit-image
- keras
- pip:
- unittest-xml-reporting
- setuptools >=38.6
- sphinx-rtd-theme
軟件包requests-negotiate-sspi
是Windows唯一的軟件包。
在environment.yml文件中,后綴Windows僅依賴於以下內容
; sys_platform == 'win32'
像這樣
- requests-negotiate-sspi; sys_platform == 'win32'
就像明智的做法,您可以將linux僅依賴項標記為
; sys_platform == 'linux'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.