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

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

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

      1. 创建 venv 时出错,错误:命令 '-Im'、'en

        时间:2023-10-08
            <bdo id='GPche'></bdo><ul id='GPche'></ul>
            1. <tfoot id='GPche'></tfoot>

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

              <legend id='GPche'><style id='GPche'><dir id='GPche'><q id='GPche'></q></dir></style></legend>
                  <tbody id='GPche'></tbody>

                  <i id='GPche'><tr id='GPche'><dt id='GPche'><q id='GPche'><span id='GPche'><b id='GPche'><form id='GPche'><ins id='GPche'></ins><ul id='GPche'></ul><sub id='GPche'></sub></form><legend id='GPche'></legend><bdo id='GPche'><pre id='GPche'><center id='GPche'></center></pre></bdo></b><th id='GPche'></th></span></q></dt></tr></i><div id='GPche'><tfoot id='GPche'></tfoot><dl id='GPche'><fieldset id='GPche'></fieldset></dl></div>
                  本文介绍了创建 venv 时出错,错误:命令 '-Im'、'ensurepip'、'--upgrade'、'--default-pip']' 返回非零退出状态 1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  当我尝试创建 venv 时,它会抛出此错误:

                  When I try to create venv it throws this error:

                  错误:命令 '['C:\Users\admin\env\Scripts\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' 返回非零退出状态 1.

                  我很奇怪,因为我用python很久了,从来没有遇到过这样的问题.

                  It is strange for me because I'm using python for a long time and never had such a problem.

                  推荐答案

                  1- 顶一下 doc 并尝试相应地修复您的全局 python 安装,不要忘记检查 Install launcher for all users 选项,成功安装后 py 启动器 将本地化在 C:Windows 文件夹下.

                  1- head over this doc and try to refix your global python installation accordingly, don't forget to check Install launcher for all users option, after successful installation the py launcher will be localed under C:Windows folder.

                  2- 使用隔离的虚拟环境,venv 内置模块比其他第三个工具更推荐,避免弄乱你的全局 python 文件夹.

                  2- use isolated vrtual environement, venv built-in module is recommended over other 3rd tools and just avoid to mess with your global python folder.

                  PS c:YOUR_PROJECT_FOLDER> py --version
                  PS c:YOUR_PROJECT_FOLDER> py -0p # many python version (3.8.x, 3.9.X, 3.10.x ..) can co-exist without any conflict
                  PS c:YOUR_PROJECT_FOLDER> py -m venv venv
                  PS c:YOUR_PROJECT_FOLDER> .venvScriptsactivate
                  (venv) PS c:YOUR_PROJECT_FOLDER> pip list 
                  Package    Version
                  ---------- -------
                  pip        20.2.3
                  setuptools 49.2.1
                  WARNING: You are using pip version 20.2.3; however, version 21.3 is available.
                  You should consider upgrading via the 'c:usersUSERdesktopYOUR_PROJECT_FOLDERvenvscriptspython.exe -m pip install --upgrade pip' command.
                  
                  # Here just copy/past that link to update the local pip of your virtual environment 
                  (venv) PS c:YOUR_PROJECT_FOLDER> c:usersUSERdesktopYOUR_PROJECT_FOLDERvenvscriptspython.exe -m pip install --upgrade pip
                  Collecting pip
                    Using cached pip-21.3-py3-none-any.whl (1.7 MB)
                  Installing collected packages: pip
                    Attempting uninstall: pip
                      Found existing installation: pip 20.2.3
                      Uninstalling pip-20.2.3:
                        Successfully uninstalled pip-20.2.3
                  Successfully installed pip-21.3
                  
                  (venv) PS c:YOUR_PROJECT_FOLDER> pip list
                  Package    Version
                  ---------- -------
                  pip        21.3
                  setuptools 49.2.1
                  
                  (venv) PS c:YOUR_PROJECT_FOLDER> pip install <PYTHON_PACKAGE>
                  

                  这篇关于创建 venv 时出错,错误:命令 '-Im'、'ensurepip'、'--upgrade'、'--default-pip']' 返回非零退出状态 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Windows的“路径"如何?环境变量工作? 下一篇:在 Windows 10 上使用 Nuitka 将 Python 3.6 脚本编译为独

                  相关文章

                  最新文章

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

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

                  1. <legend id='Wrg96'><style id='Wrg96'><dir id='Wrg96'><q id='Wrg96'></q></dir></style></legend>
                  2. <tfoot id='Wrg96'></tfoot>