Windows 7、Anaconda 2019.10、python 3.11.0 hcf16a7b_0_cpython conda-forge。
在激活环境然后在 powershell 中停用它后,我收到此错误:
Remove-Item : Cannot bind parameter 'ErrorAction'. Cannot convert value 'Ignore' to type 'System.Man
agement.Automation.ActionPreference" due to invalid enum values. Specify one of the following list values
clear and try again. The following enumeration values are possible: "SilentlyContinue, Stop, Continue, Inquire".
C:\ProgramData\Anaconda3\envs\pcraster\etc\conda\deactivate.d\gdal-deactivate.ps1:1 pos:39
+ remove-item ENV:GDAL_DATA -ErrorAction <<<< Ignore
+ CategoryInfo : InvalidArgument: (:) [Remove-Item], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.RemoveItemCommand
Same error for position 46
我应该在这里修复什么?
答案1
在 中gdal-deactivate.ps1
,全部替换-ErrorAction Ignore
为-ErrorAction SilentlyContinue
在更高版本的 powershell/.net 中添加了“忽略”错误操作