简体   繁体   English

Pip安装最新版本的matplotlib?

[英]Pip installing latest version of matplotlib?

I wanted to use a functionality of matplotlib's more recent versions, and I noticed that my matplotlib is out of date. 我想使用matplotlib的最新版本的功能,我注意到我的matplotlib已经过时了。 I tried upgrading it with pip, which was successful according to PIP. 我尝试使用pip对其进行升级,根据PIP,此操作已成功完成。 As can be seen in this screenshot: 如该屏幕截图所示:

在此处输入图片说明

As you can see pip says 1.4.6 is installed at /Library/Python/2.7/site-packages . 如您所见,pip说1.4.6安装在/Library/Python/2.7/site-packages

If I try the upgrade command, nothing new is installed as it says the most recent version is installed. 如果我尝试执行upgrade命令,则不会安装任何新内容,因为它表示已安装最新版本。 Nevertheless, If I import matplotlib and then check the version, you can see that 1.1.1 is installed. 不过,如果我导入matplotlib,然后检查版本,则可以看到已安装1.1.1。 I also add the location of the site-packages folder. 我还添加了site-packages文件夹的位置。

Why, according to pip is the latested version installed, but when I import it, it is not the latest version ? 为什么根据pip会安装最新版本,但是在我导入时却不是最新版本? Also in the site package folder I find: matplotlib-1.4.2.dist-info 同样在站点包文件夹中,我找到: matplotlib-1.4.2.dist-info

I work on mac osx 10.9.5 我在Mac OS X 10.9.5上工作

Your paths are messed up (most probably the $PYTHONPATH ). 您的路径混乱了(很可能是$PYTHONPATH )。 Check the location of version 1.1.1 using 使用以下命令检查版本1.1.1的位置

import matplotlib
print matplotlib.__file__

and you may see what's going on. 您可能会看到发生了什么事。 I already saw multiple package installations in the same folder, so have a look at the files in site-packages too. 我已经在同一个文件夹中看到了多个软件包安装,因此也请查看站点软件包中的文件。 Of course you should delete the older package to avoid path confusion in future ; 当然,您应该删除较旧的软件包,以免将来造成路径混乱; )

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM