简体   繁体   English

如何告诉OSX使用brew中的matplotlib,而不是默认值?

[英]How do I tell OSX to use matplotlib from brew, rather than default?

I have OSX 10.9.5 and installed matplotlib via brew, but apparently there was a bundled version too. 我有OSX 10.9.5,并通过brew安装了matplotlib,但显然也有捆绑版本。 The version from brew is 1.4.2 and the bundled version is 1.1.1, and when I import matplotlib I get 1.1.1. brew的版本是1.4.2,捆绑的版本是1.1.1,当我import matplotlib我得到1.1.1。 I'm a python beginner, how do I get it to use the brew (1.4.2) version? 我是python初学者,如何使用brew(1.4.2)版本?

Due to how python environment works, both python and matplotlib need to be installed via homebrew on OS X. After installing make sure your python in path is set to the one installed via brew. 由于python环境是如何工作的,因此python和matplotlib都需要通过OS X上的homebrew安装。安装后,请确保路径中的python设置为通过brew安装的python。

Remove the python and matplotlib in case they are installed via brew: 如果通过brew安装,请删除python和matplotlib:

 brew rm python; brew rm matplotlib

Reinstall python and matplotlib: 重新安装python和matplotlib:

 brew install python; brew install matplotlib

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

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