简体   繁体   English

没有名为 pip 的模块 - Python 3.9

[英]No module named pip - Python 3.9

I normally do not use python, but needed it now.我通常不使用 python,但现在需要它。 So I installed python 3.9 (on Ubuntu/WSL2 subsystem on Windows 10).所以我安装了 python 3.9(在 Windows 10 上的 Ubuntu/WSL2 子系统上)。

I need pip to.我需要 pip 来。 I thought it should be there by default (but it was not there):我认为它应该默认存在(但它不存在):

Starting with Python 3.4, it is included by default with the Python binary installers.从 Python 3.4 开始,它默认包含在 Python 二进制安装程序中。 ( https://docs.python.org/3/installing/index.html ) https://docs.python.org/3/installing/index.html

So I went on to the next page ( https://packaging.python.org/tutorials/installing-packages/ ).所以我继续下一页( https://packaging.python.org/tutorials/installing-packages/ )。 It told me to do它告诉我要做

python -m ensurepip --default-pip

This did not work either.这也不起作用。 So I tested next instructions:所以我测试了下一条指令:

sudo wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

This failed with这失败了

ModuleNotFoundError: No module named 'distutils.command' ModuleNotFoundError:没有名为“distutils.command”的模块

Am I doing something wrong?难道我做错了什么? Or is there a bug somewhere?还是某处有错误?

It looks like a documentation error.它看起来像一个文档错误。 I followed the instructions here and that worked:我按照此处的说明进行操作,并且有效:

https://askubuntu.com/questions/1239829/modulenotfounderror-no-module-named-distutils-util https://askubuntu.com/questions/1239829/modulenotfounderror-no-module-named-distutils-util

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM