win10激活python虚拟环境_Virtualenvwrapperwin已安装在Windows 10上,但无法激活虚拟环境...

当我尝试使用命令workon 激活虚拟环境时,虚拟环境不会激活。我使用的是Windows10机器,安装了Virtualenv、VirtualEnvRapper和VirtualEnvRapper win。在

例如,当我在命令shell中输入lsvirtualenv时,我可以看到虚拟环境存在,但我无法激活它。你能帮帮我吗?在

编辑1:

当我试图直接激活文件时,我从终端收到以下错误:PS C:\users\stefan\envs\rango\scripts> .\activate .\activate : File C:\users\stefan\envs\rango\scripts\activate.ps1 cannot be loaded. The contents of file C:\users\stefan\envs\rango\scripts\activate.ps1 might have been changed by an unauthorized user or process, because the hash of the file does not match the hash stored in the digital signature. The script cannot run on the specified system. For more information, run Get-Help about_Signing.. At line:1 char:1 + .\activate + ~~~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : Unauth –

编辑2-

我以管理员身份运行powershell并将执行策略更改为“remotesigned”,从而使其正常工作。方法如下:

如果当前控制台未提升并且您尝试执行的操作

需要提升的权限,然后可以使用“Run as administrator”启动powershell

选项:

^{pr2}$

可以使用Get-ExecutionPolicycmdlet标识当前执行策略:PS C:\Users\Administrator> get-executionpolicy

为了更改当前的执行策略,Set-ExecutionPolicy cmdlet是

与新的执行策略设置结合使用。例如,更改为

远程签名时,应执行以下命令:PS C:\Users\Administrator> set-executionpolicy remotesignedExecution Policy

Description

Restricted The default policy on Windows PowerShell, this mode disables the execution of script files. Windows PowerShell may only be used by manually issuing commands at the command prompt.

AllSigned Limits execution to scripts which are authenticode signed. When a signed script is executed, PowerShell will prompt for confirmation that the signer of the script can be trusted.

RemoteSigned Requires that any scripts that have been downloaded from a remote location must be signed before they may are permitted to execute.

Unrestricted Allows any script to be executed, regardless of origin or whether it is signed.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值