python - 在“windows-latest”vm上使用powershell任务时如何在azure上使用conda?
问题描述
我正在尝试在 Windows vm 上的 azure 管道中使用 conda。在这个问题中,解决方案是eval $(conda shell.bash hook)
在 linux 和 macos 上使用对我有用的方法,但由于明显的原因在 windows 上失败了。在 windows vm 下使用 powershell 任务时的等价物是什么?
我试过了
conda shell.powershell hook
和
call conda shell.powershell hook
和
conda init powershell
但所有这些都失败了
No action taken.
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
如何让 conda 与 powershell 和 windows vm 一起使用?
我正在使用的 azure yaml 是:
- powershell: |
conda shell.powershell hook
conda activate pyomexmeta
cd $(INSTALL_DIRECTORY)
python setup.py bdist_wheel
$wheel = Get-ChildItem -LiteralPath . -Recurse -File |% FullName
pip install $wheel
ipython -c "import pyomexmeta;pyomexmeta.run_tests()"
解决方案
推荐阅读
- asp.net-core - .netCore 5 区域路由在 RedirectToActionArea 中不起作用并作为查询字符串
- c - dyld:在makefile中链接时未加载库
- python - Django说字段存在时不存在
- javascript - VS Code + jsconfig.json:“找不到模块...”用于具有内置类型的 NPM 模块
- scala - 如何将 Spark/Scala RDD 合并/加入到 List 中,以便 RDD 中的每个值与每个 List 项一起获得一个新行
- javascript - 未使用 wavesurfer 创建的波形
- ios - Swift -开始/停止同步操作队列
- amazon-web-services - 可以使用 Cyberduck 访问 AWS 公共数据集吗?
- flutter - Flutter 网站需要时间才能出现
- laravel - Optimistdigital nova-menu-builder 中的自定义菜单项