简体   繁体   English

安装 pip 后没有名为 pip 的模块

[英]No module named pip after installing pip

I'm trying to download gzip and pip was outdated.我正在尝试下载 gzip 并且 pip 已过时。 I type the following:我输入以下内容:

C:\Users\username>py get-pip.py

And then I checked if the pip was updated:然后我检查了 pip 是否已更新:

C:\Users\username>pip --version
pip 22.2.1 from C:\Users\username\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pip (python 3.8)

But when I tried again to pip install, I got the following error message:但是当我再次尝试安装 pip 时,我收到以下错误消息:

C:\Users\username>py -m pip install "gzip"
C:\ProgramData\Anaconda3\python.exe: No module named pip

I think I have two versions of Python and I don't know if I should delete one or not (3.8 and 3.6.1).我想我有两个版本的 Python,我不知道是否应该删除一个(3.8 和 3.6.1)。

C:\Users\username>py --version
Python 3.6.1 :: Anaconda 4.4.0 (64-bit)

Any help is appreciated任何帮助表示赞赏

First of all, gzip is part of the standard library.首先, gzip是标准库的一部分。 Doesn't need installed.不需要安装。


py command on your PATH is coming from Anaconda. PATH 上的py命令来自 Anaconda。 You should be able to use conda install , then instead.然后,您应该可以使用conda install

You have two different installations of Python on your system.您的系统上有两个不同的 Python 安装。 The one from the App Store (Python 3.8, which has pip ), and the one from Anaconda (Python 3.6) which does not.来自 App Store 的一个(Python 3.8,它有pip ),另一个来自 Anaconda(Python 3.6),它没有。

Ideally, you should keep/upgrade Anaconda, as it is more feature-rich, depending on your needs, and uninstall the other.理想情况下,您应该保留/升级 Anaconda,因为它功能更丰富,具体取决于您的需要,然后卸载另一个。

This means pip is not installed on the python environment you are trying to access.这意味着 pip 未安装在您尝试访问的 python 环境中。 So in order to access a specific version of python you can try something like this:因此,为了访问 python 的特定版本,您可以尝试以下操作:

Python 3.6.1 Python 3.6.1

python3.6 -m pip --version

Python 3.8 Python 3.8

python3.8 -m pip --version

This should allow you to access a specific version of python and see which instance pip is being installed to.这应该允许您访问特定版本的 python 并查看正在安装哪个实例 pip。

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

相关问题 使用pip安装后,“ImportError:没有名为'requests'的模块” - “ImportError: no module named 'requests'” after installing with pip 通过 pip 安装后没有名为“folium”的模块 - No module named 'folium' after installing via pip ModuleNotFoundError:没有名为“passlib”的模块,即使在 pip 安装和 pipenv 安装之后 - ModuleNotFoundError: No module named 'passlib', even after pip installing and pipenv installing 安装pip后没有名为“ pip”的模块 - No module named 'pip' after pip installed 使用 pip 安装后,jupyter Notebook 中没有名为“pydotplus”的模块 - No module named 'pydotplus' in jupyter Notebook after installing it using pip 在 Python 3.10.5 中使用 pip3 安装后出现“没有名为‘openpyxl’的模块” - "No module named 'openpyxl'" after installing with pip3 in Python 3.10.5 即使使用pip成功安装了名为“ cv2”的模块,也没有 - No module named 'cv2' even after successfully installing it using pip Python:使用pip安装xlrd后“导入错误:没有名为xlrd的模块” - Python: “ImportError: no module named xlrd” after installing xlrd using pip 使用pip安装后的Python“No Module named gTTS” - Python "No Module named gTTS" after installing it using pip 导入错误:通过 PIP 安装 Ansible 2.9 后没有名为 ansible 的模块 - ImportError: No module named ansible after installing Ansible 2.9 via PIP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM