Matplotlib 版本 [英] Matplotlib Version

查看:24
本文介绍了Matplotlib 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在成功安装 numpy 和 scipy 后,让我的系统准备好自制软件并使用 pip install matplotlib,我得到了成功的安装.然后,运行

Having my system prepped with homebrew and using pip install matplotlib after successful installation of numpy and scipy, I'm getting a successful installation. Then, running

$ python
Python 2.7.6 (default, Jan 30 2014, 20:19:23) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'1.1.1'

这是一个非常过时的版本,我的程序中没有人运行它.我使用了 pip卸载matplotlib ,并用 pip install'1.3.1的url'对其进行了重编,它仍然读取版本1.1.1.有没有办法我可以手动删除所有python库,甚至python本身,并从头开始重新启动?还是这明显解决了这个问题?

This is a very outdated version and noone of my programs run with it. I used pip uninstall matplotlib and redid it with pip install 'the url for 1.3.1' and it still reads version 1.1.1. Is there a way I can manually delete all python libraries, even python itself, and restart from scratch? Or is this an obvious fix for this?

我运行的是 Mac OS X 10.9 版.我刚刚通过macports用scipy,numpy和matplotlib重新安装了python 2.7.有没有一种非常基本的方法可以查看当我从 python 环境 import matplotlib 调用它时的位置?就像终端中的哪个一样?我开始使用自制软件,但切换到 macports 以获得更多控制.这可能是个问题吗?我需要完全删除自制软件吗?

I'm running Mac OS X version 10.9. I just reinstalled python 2.7 with scipy, numpy, and matplotlib through macports. Is there a very basic way to see where, when I import matplotlib from the python environment, it is calling it from? Like which in the terminal? I began using homebrew but switched to macports for more control. Can that be a problem? Do I need to completely remove homebrew?

我一开始确实收到了这条消息:Warning: E​​rror parsing file/Applications/MacPorts/Python 2.7/Python Launcher.app/Contents/MacOS/Python Launcher: Error opening or reading file 但在运行后 $ sudo port -f activate python27 后跟 sudo port activate python27 我不再有那个警告,但为了完整起见,我想包括这个细节.

I did get this message at first: Warning: Error parsing file /Applications/MacPorts/Python 2.7/Python Launcher.app/Contents/MacOS/Python Launcher: Error opening or reading file but after running $ sudo port -f deactivate python27 followed by sudo port activate python27 I no longer have that warning, but I wanted to include this detail for completeness.

编辑 2:当需要将某些内容安装到 usr/local/bin 时,是否可以将它们安装到 opt/local/bin?

EDIT 2: Could some things be installing to opt/local/bin when they need to be installed to usr/local/bin?

为了阐明这一点, print scipy .__ version __ 读取 0.11.0 ,这是一些过时的 print numpy .__ version __ 读取 1.6.2 也是过时的.但是我尝试安装说安装成功,我不怀疑.我怀疑它没有以正确的方式链接在一起.有没有办法删除连接到python的所有内容并重新启动?

EDIT 3: To shed some light on this, print scipy.__version__ reads 0.11.0 which is several outdated, print numpy.__version__ reads 1.6.2 which is also outdated. However I attempt to install says the installation was successful, which I don't doubt. I suspect it's not linked up together in a correct way. Is there a way delete everything that is connected to python at all and restart?

最终我认为处理这个问题的最简单方法是运行 which python 并查看运行 python 的选项.因为此时我使用自制软件和Macports(不建议使用),所以我有四个选择:一个Macports安装,一个来自python.org的软件包安装,一个自制软件安装以及来自Apple的标准2.6版本.遍历这些并找到您的安装程序(pipeasy_install)正在放置您的框架并在您需要某些依赖项时运行该 python.最好的方法是,如果需要不同的依赖项,则仅使用一个程序包管理器并运行虚拟环境,但是我们正在学习.

FINAL I think the easiest way to handle this is to run which python and see what options you have to run python. Because I used homebrew and macports at this time (not recommended) I had four options- a macports install, a package install from python.org, a homebrew install, and the standard 2.6 from Apple. Iterate through these and find which one your installer (pip or easy_install) is placing your frameworks and run that python when you need certain dependencies. The best way is use only one package manager and run virtual environments if you need different dependencies, but we're all learning as we go.

推荐答案

问题出在 $PATH 变量上.我没有更改该变量中的某些内容,而是卸载了 ./Library/Frameworks/ 中的所有包.无论哪种方式都会起作用.当我得知当前版本是 '1.1.1' 时,这是 Mac 上安装的标准 python 的当前版本,即 2.6 版,当时我正在使用所有当前库进行更新为 2.7.

The problem was with the $PATH variable. Instead of changing something in that variable, I uninstalled all packages in ./Library/Frameworks/. Either way would work. When I was getting that my current version was '1.1.1', that was the current version for the standard python installed on Mac, which is version 2.6, when I was updating with all of the current libraries for 2.7.

注意:卸载框架时,请不要卸载2.6,因为预先安装的mac build已用于许多其他Mac程序,而我最终不得不重新安装操作系统.

NOTE: When uninstalling the frameworks, do not uninstall 2.6 however because the preinstalled mac build is used for a lot of other Mac programs, and I ended up having to reinstall my OS.

这篇关于Matplotlib 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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