为什么 pip3 安装在 python2 站点包中 [英] Why pip3 install in python2 sitepackages

查看:41
本文介绍了为什么 pip3 安装在 python2 站点包中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先我使用

Python 3.6.5
Python 2.7.14
and mac.

就我而言,当我使用 pip3 时,我只是下载像 numpy 这样的模块(例如,和其他的一样)它说像..

In my case, I just download module like numpy(for example, and other's same) when i use pip3 it said like..

和 pip 是一样的.

and pip is same.

但是当我使用它时,在 python3

but when I use it, in python3

python2 中,它运行良好...

In python2, It working well...

我该如何解决?

推荐答案

pip3 似乎是指 Python-2.7 的 pip 模块或您已安装的任何其他版本的 Python-3你的机器.但是,您可以使用预期的 Python 版本直接安装包.你只需要使用 -m 选项.

It seems that pip3 refers to Python-2.7's pip module or any other version of Python-3 that you have installed on your machine. However, you can install packages directly using the intended Python version. You'd need to just use -m option.

python3.6 -m pip install numpy

另一个选项是更改 pip3 引用的源路径.您可以通过找到 Python-3.6 的 pip 路径并将其绑定到 pip3 别名来实现.

Another option is to changing the source path that pip3 refers to. You can do this by finding the path of Python-3.6's pip and just bind it to pip3 alias.

这篇关于为什么 pip3 安装在 python2 站点包中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆