错误:命令' [' c:\\ users \\ u \\ de \\ venv \\ scripts \\ python.exe' exe',' -im' ,,&#,,&# X27; SublyPip',' - 升级',' - default-pip']'返回的非零退出状态101

发布于 2025-02-10 20:46:23 字数 300 浏览 1 评论 0原文

每当我尝试在Python中创建虚拟环境时,我都会得到此错误

错误:命令'['c:\ users \ u \ desktop \ venv \ scripts \ python.exe','' - im','suarspip',' - upgrade',' - default-pip'] '返回的非零退出状态101。

我正在使用Windows 10。 我尝试卸载Python并重新安装了几次,但问题仍然持续。

从几年来开始,我一直在计算机上使用Python,但是现在我面临着这个错误。

Whenever I try to create virtual environment in python I get this error

Error: Command '['C:\Users\u\Desktop\venv\Scripts\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101.

I am using Windows 10.
I tried uninstalling python and reinstalled it several times but still the problem continues.

I have been using python on my computer from years but now I am facing this error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

潦草背影 2025-02-17 20:46:23

只需删除您当前的Python目录,然后从官方网页中再次重新加载它

just delete your current python directory and reload it again from official web page
enter link description here

笑饮青盏花 2025-02-17 20:46:23

当我当前的工作文件夹中的VENV文件夹时,我也会有类似的错误。看看是否有一个..如果您确实删除它,然后重试,它应该起作用。

如果第一步之后使用VSCODE,则可能需要转到查看命令pallette-pallette select intepreter-然后选择python venv。

I got a similar error when I already had a venv folder in my current working folder. See if you have one.. if you do delete it and try again and it should work.

Might need to go to view-command pallette-select intepreter- then select python venv if using vscode after the first step.

独自←快乐 2025-02-17 20:46:23

我在尝试将Python Venv作为非root用户时在Redhat服务器上遇到了这个问题。

这是关于VENV创建失败的详细输出。

$ python-venv/bin/python3 -Im ensurepip --upgrade --default-pip
Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib64/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib64/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/lib64/python3.6/ensurepip/__init__.py", line 21, in <module>
    _SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")
  File "/usr/lib64/python3.6/ensurepip/__init__.py", line 18, in _get_most_recent_wheel_version
    return str(max(versions, key=distutils.version.LooseVersion))

我没有刻薄的态度来验证Python安装是否正确,但我认为不是。

I had this issue on a redhat server while trying to make a python venv as a non-root user.

Here is a detailed output on why the venv creation fail.

$ python-venv/bin/python3 -Im ensurepip --upgrade --default-pip
Traceback (most recent call last):
  File "/usr/lib64/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/usr/lib64/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/usr/lib64/python3.6/runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "/usr/lib64/python3.6/ensurepip/__init__.py", line 21, in <module>
    _SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")
  File "/usr/lib64/python3.6/ensurepip/__init__.py", line 18, in _get_most_recent_wheel_version
    return str(max(versions, key=distutils.version.LooseVersion))

I don't have a mean to verify if the python installation is correct, but I assume it isn't.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文