【发布时间】:2015-05-12 22:53:30
【问题描述】:
我尝试在 python 中使用 matplotlib 可视化图形,但我的 mac (Yosemite 10.10.2) 中几乎没有问题。我已经安装了matplotlib,我知道我的电脑里安装了2个python版本,分别是2.7.8和2.7.6
使用默认解释器是 python 2.7.8,我得到了这个错误
dhcPlus-mbp:~ macbook$ python
Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named matplotlib
但是如果我尝试这个,它可以在终端上运行。但我无法使用 Ctrl+B 直接从我的 Sublime 构建
dhcPlus-mbp:~ macbook$ /usr/bin/python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>>
我的问题是,如何更改默认的 Python 解释器,以便在我的环境中使用 2.7.6?
非常感谢任何帮助。非常感谢。
【问题讨论】:
标签: python macos python-2.7 matplotlib