'virtualenv' 不会在 Windows 上激活 [英] 'virtualenv' won't activate on Windows

查看:33
本文介绍了'virtualenv' 不会在 Windows 上激活的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我似乎无法激活我创建的 virtualenv 环境.

Essentially I cannot seem to activate my virtualenv environment which I create.

我通过 using 在 Windows PowerShell 中执行此操作

I'm doing this inside of Windows PowerShell through using

scripts\activate

但我收到一条错误消息:

but I get an error message:

"无法加载,因为在此上禁用了脚本的执行系统".

"cannot be loaded because the execution of scripts is disabled on this system".

这可能是因为我的电脑没有管理员权限吗?

Could this be because I don't carry administrator privileges on my computer?

推荐答案

根据微软技术支持它可能是执行策略设置的问题.要修复它,您应该尝试在 PowerShell 窗口中执行 Set-ExecutionPolicy Unrestricted -Scope Process(如@wtsiamruk 的评论部分所述).这将允许在当前 PowerShell 会话中运行 virtualenv.

According to Microsoft Tech Support it might be a problem with Execution Policy Settings. To fix it, you should try executing Set-ExecutionPolicy Unrestricted -Scope Process (as mentioned in the comment section by @wtsiamruk) in your PowerShell window. This would allow running virtualenv in the current PowerShell session.

还有另一种更不安全的方法,但 MS 技术支持推荐.这种方法是使用 Set-ExecutionPolicy Unrestricted -Force(它会释放力量来搞砸你的系统).但是,在您使用这种不安全的方式之前,请务必使用 get-ExecutionPolicy 检查您当前的 ExecutionPolicy 设置.然后,当你完成后,你可以使用 Set-ExecutionPolicy %get-ExecutionPolicy 命令给你的值% -Force 来恢复到这个 ExecutionPolicy.

There is also another approach that is more unsafe, but recommended by MS Tech Support. This approach would be to use Set-ExecutionPolicy Unrestricted -Force (which do unleash powers to screw Your system up). However, before you use this unsafe way, be sure to check what your current ExecutionPolicy setting is by using get-ExecutionPolicy. Then, when you are done, you can revert back to this ExecutionPolicy by using Set-ExecutionPolicy %the value the get-ExecutionPolicy command gave you% -Force.

这篇关于'virtualenv' 不会在 Windows 上激活的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆