简体   繁体   English

使用Anaconda安装pip

[英]Use Anaconda installed pip

I have 我有

python --version
Python 3.6.9 :: Anaconda, Inc.

but

pip3 --version
pip 19.2.2 from /home/ss/.local/lib/python3.5/site-packages/pip (python 3.5)
pip --version
pip 19.2.2 from /home/ss/.local/lib/python3.5/site-packages/pip (python 3.5)

I installed pip for anaconda as 我为anaconda安装了pip作为

conda install -c anaconda pip

But it did not change the pip path, it is still 3.5 sys path. 但它没有改变pip路径,它仍然是3.5 sys路径。

How do I use pip installed in anaconda python dir for python 3.6.9? 如何使用安装在anaconda python目录中的pip for python 3.6.9?

Use python -m pip <operation> 使用python -m pip <operation>

The reason you want to use python -m <module> is that pip might not necessarily refer to the python installation you are referring to. 你想使用python -m <module>pip可能不一定是指你所指的python安装。 Even if you have run activate /some/env , that still doesn't guarantee that the pip binary will be the one used. 即使您运行了activate /some/env ,仍然不能保证pip二进制文件将是使用的那个。

For instance, the $PATH environment variable might have the python paths appended rather than prepended, so pip might live in /usr/local/bin which will be searched first, giving the wrong pip . 例如, $PATH环境变量可能附加了python路径而不是prepended,因此pip可能存在于/usr/local/bin ,它将首先被搜索,从而产生错误的pip

However, you know which python you want to use, and by using the -m flag, you explicitly tie that module to the python version specified by python 但是,你知道你要使用,并通过使用哪一种Python -m标志,明确配合该模块通过指定的Python版本python

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

相关问题 Anaconda找不到我的安装了`pip`的软件包 - Anaconda not finding my packages installed with `pip` 如何在使用 pip 安装的 Anaconda 中卸载软件包 - How to uninstall package in Anaconda installed with pip pip本地软件包已安装但不可用-anaconda - pip local package installed but not available - anaconda 在anaconda中没有使用pip安装任何软件包 - no package gets installed using pip in anaconda Anaconda 在新环境中预先安装了 pip 包 - Anaconda pre installed pip packages in new env How to use in Julia a Python package that is not available in Anaconda and needs to be installed via pip - How to use in Julia a Python package that is not available in Anaconda and needs to be installed via pip 如果我使用 pip 安装 Anaconda 中未包含的软件包,package 是否也会安装在 conda 环境中? - Does a package also gets installed in conda environment if I use pip to install packages not included in Anaconda? 在我安装 anaconda 后没有新的 pip 安装的模块可以导入 - after I installed anaconda no new pip installed modules can be imported Anaconda更新与pip更新和conda更新冲突,并且安装在anaconda中的pip似乎已损坏 - Anaconda update conflicts with pip update and conda update, and pip installed in anaconda seems broken 无法导入使用 pip 安装的模块(anaconda python) - Can't import module installed with pip (anaconda python)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM