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

查看:125
本文介绍了为什么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..

和点子相同.

但是当我使用它时,在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天全站免登陆