<legend id='ubKjr'><style id='ubKjr'><dir id='ubKjr'><q id='ubKjr'></q></dir></style></legend>
      <bdo id='ubKjr'></bdo><ul id='ubKjr'></ul>
  • <tfoot id='ubKjr'></tfoot>
    <i id='ubKjr'><tr id='ubKjr'><dt id='ubKjr'><q id='ubKjr'><span id='ubKjr'><b id='ubKjr'><form id='ubKjr'><ins id='ubKjr'></ins><ul id='ubKjr'></ul><sub id='ubKjr'></sub></form><legend id='ubKjr'></legend><bdo id='ubKjr'><pre id='ubKjr'><center id='ubKjr'></center></pre></bdo></b><th id='ubKjr'></th></span></q></dt></tr></i><div id='ubKjr'><tfoot id='ubKjr'></tfoot><dl id='ubKjr'><fieldset id='ubKjr'></fieldset></dl></div>
      1. <small id='ubKjr'></small><noframes id='ubKjr'>

        virtualenv v16.7.2 powershell activate 脚本:&quot;你必须

        时间:2023-10-08

            <i id='GQnaG'><tr id='GQnaG'><dt id='GQnaG'><q id='GQnaG'><span id='GQnaG'><b id='GQnaG'><form id='GQnaG'><ins id='GQnaG'></ins><ul id='GQnaG'></ul><sub id='GQnaG'></sub></form><legend id='GQnaG'></legend><bdo id='GQnaG'><pre id='GQnaG'><center id='GQnaG'></center></pre></bdo></b><th id='GQnaG'></th></span></q></dt></tr></i><div id='GQnaG'><tfoot id='GQnaG'></tfoot><dl id='GQnaG'><fieldset id='GQnaG'></fieldset></dl></div>
              <bdo id='GQnaG'></bdo><ul id='GQnaG'></ul>

              <legend id='GQnaG'><style id='GQnaG'><dir id='GQnaG'><q id='GQnaG'></q></dir></style></legend>
            • <tfoot id='GQnaG'></tfoot>

              <small id='GQnaG'></small><noframes id='GQnaG'>

                <tbody id='GQnaG'></tbody>

                  本文介绍了virtualenv v16.7.2 powershell activate 脚本:&quot;你必须'source'这个脚本:PS&gt;..ENVScriptsactivate"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  python v.3.7.4 上最新版本的 virtualenv (16.7.2) 为activate.ps1"增加了 4 行.脚本,在 Windows10 powerhsell 上运行时会出现错误:You must 'source' this script: PS>..ENVScriptsactivate我该如何解决?(请注意,我已经阅读并完成了其他论坛问题以及与 windows 和 powershell 相关的 virtualenv 手册中提到的所有内容.)

                  Newest version of virtualenv (16.7.2) on python v.3.7.4 has 4 additional lines for the "activate.ps1" script, which when run on Windows10 powerhsell gives the error: You must 'source' this script: PS> . .ENVScriptsactivate How do I fix this? (please note that I have read and done all that was mentioned on the other forum questions as well as the manual for virtualenv related to windows and powershell.)

                  我已将执行策略设置为 RemoteSigned(按照其他论坛的建议):

                  I have set the execution policy to RemoteSigned (as recommended in other forums):

                  Get-ExecutionPolicy -List
                  
                          Scope ExecutionPolicy
                          ----- ---------------
                  MachinePolicy       Undefined
                     UserPolicy       Undefined
                        Process       Undefined
                    CurrentUser       Undefined
                   LocalMachine    RemoteSigned
                  

                  当我想激活 virtualenv 时,我运行 .ENVScriptsactivate

                  When I want to activate virtualenv, I run .ENVScriptsactivate

                  问题在于创建新虚拟环境时由 virtualenv 自动生成的 activate.ps1 脚本的第 3 到 6 行:

                  The problem is with lines 3 to 6 of the activate.ps1 script that is auto generated by virtualenv when you make a new virtual environment:

                  if (@($null,"Internal") -notcontains $myinvocation.commandorigin) {
                      Write-Host -Foreground red "You must 'source' this script: PS> . $($myinvocation.invocationname)"
                      exit 33
                  }
                  

                  似乎 $myinvocation.commandorigin 设置为 Runspace 而不是 Internal

                  It seems that $myinvocation.commandorigin is set to Runspace instead of Internal

                  我该如何解决这个问题?有任何想法吗?谢谢 :)))请注意,我不想手动调整每个自动生成 activate.ps1 文件.

                  How do I fix this? Any ideas? Thanks :))) Note that I don't want to manually adjust every auto-gen activate.ps1 file.

                  推荐答案

                  我们来看看那个错误信息:

                  Let's have a look at that error message:

                  您必须获取"此脚本:PS>..ENVScriptsactivate

                  Hmmmm... - PS> 可能只是提示,给我们留下了这样的提示:

                  Hmmmm... - PS> is probably just the prompt, which leaves us with this:

                    . .ENVScriptsactivate
                  # ^
                  # |
                  # Check out this guy
                  

                  那个,路径前面那个孤独的.,也就是powershell中的dot-source operator.

                  That, the lonely . in front of the path, that is the dot-source operator in powershell.

                  根据 文档,它:

                  在当前范围内运行脚本,以便将脚本创建的任何函数、别名和变量添加到当前范围内.

                  Runs a script in the current scope so that any functions, aliases, and variables that the script creates are added to the current scope.

                  我没有看过 virtualenv,但我认为它需要定义一些变量并确保这些变量在脚本运行后仍然存在,它需要运行在当前范围内.

                  I haven't had a look at virtualenv, but I assume it'll want to define a number of variables and to ensure that these persist after the script has run, it needs to be run in the current scope.

                  所以这是你必须运行的 literal 命令来修复它:

                  So this is the literal command you have to run to fix it:

                  . .ENVScriptsactivate
                  

                  这篇关于virtualenv v16.7.2 powershell activate 脚本:&quot;你必须'source'这个脚本:PS&gt;..ENVScriptsactivate"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 Python 3 中更改 Windows 10 背景 下一篇:在 Python 命令行上定义函数时出现语法错误

                  相关文章

                  最新文章

                    <bdo id='kmBsw'></bdo><ul id='kmBsw'></ul>

                • <legend id='kmBsw'><style id='kmBsw'><dir id='kmBsw'><q id='kmBsw'></q></dir></style></legend>

                    1. <small id='kmBsw'></small><noframes id='kmBsw'>

                    2. <tfoot id='kmBsw'></tfoot>

                      <i id='kmBsw'><tr id='kmBsw'><dt id='kmBsw'><q id='kmBsw'><span id='kmBsw'><b id='kmBsw'><form id='kmBsw'><ins id='kmBsw'></ins><ul id='kmBsw'></ul><sub id='kmBsw'></sub></form><legend id='kmBsw'></legend><bdo id='kmBsw'><pre id='kmBsw'><center id='kmBsw'></center></pre></bdo></b><th id='kmBsw'></th></span></q></dt></tr></i><div id='kmBsw'><tfoot id='kmBsw'></tfoot><dl id='kmBsw'><fieldset id='kmBsw'></fieldset></dl></div>