点列表和sudo点列表显示了不同的软件包版本 [英] pip list and sudo pip list shows different package versions

查看:103
本文介绍了点列表和sudo点列表显示了不同的软件包版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台Mac,我用Homebrew安装了Python,并用pip安装了软件包.但是我发现当我分别调用pip listsudo pip list时,它实际上提供了不同的软件包版本.例如,我在sudo pip list中具有ipython(3.1.0),而在pip list中具有ipython(2.3.0).这是什么意思?我是否同时安装了两个版本?

I have a Mac, I installed Python with Homebrew and I installed packages with pip. But I found out when I call pip list and sudo pip list, it actually gives different package versions. For example, I have ipython (3.1.0) in sudo pip list and ipython (2.3.0) in just pip list. What does it mean? Do I have two both versions installed?

我发现它的原因是因为当我升级某些软件包时,我的系统拒绝了许可,所以我使用了sudo,我做错了吗?

The reason I found out about it is because when I upgrade some of the packages, my system denied the permission, so I used sudo, did I do it wrong?

推荐答案

答案很简单:您的python环境使用不同的路径.做

The answer is pretty easy: your python environment is using different paths. do

$ which pip
$ sudo which pip

您将获得两条不同的路径.

and you'll get two different paths.

认真考虑改用python virtualenv,这样可以更好地控制您.

Seriously consider changing over to use python virtualenv, which gets you lots better control.

这篇关于点列表和sudo点列表显示了不同的软件包版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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