Unable to “import matplotlib.pyplot as plt” in virtualenv

 


(PyMVPA) SimilarFacedeMacBook-Pro:PyMVPA similarface$ pip install matplotlib

Collecting matplotlib

Downloading matplotlib-2.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (13.2MB)

100% |████████████████████████████████| 13.2MB 18kB/s

Collecting pytz (from matplotlib)

Downloading pytz-2017.3-py2.py3-none-any.whl (511kB)

100% |████████████████████████████████| 512kB 3.8kB/s

Collecting six>=1.10 (from matplotlib)

Downloading six-1.11.0-py2.py3-none-any.whl

Collecting backports.functools-lru-cache (from matplotlib)

Downloading backports.functools_lru_cache-1.4-py2.py3-none-any.whl

Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib)

Using cached pyparsing-2.2.0-py2.py3-none-any.whl

Requirement already satisfied: numpy>=1.7.1 in ./lib/python2.7/site-packages (from matplotlib)

Collecting python-dateutil>=2.0 (from matplotlib)

Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)

100% |████████████████████████████████| 194kB 70kB/s

Collecting cycler>=0.10 (from matplotlib)

Using cached cycler-0.10.0-py2.py3-none-any.whl

Collecting subprocess32 (from matplotlib)

Downloading subprocess32-3.2.7.tar.gz (54kB)

100% |████████████████████████████████| 61kB 46kB/s

Building wheels for collected packages: subprocess32

Running setup.py bdist_wheel for subprocess32 ... done

Stored in directory: /Users/similarface/Library/Caches/pip/wheels/7d/4c/a4/ce9ceb463dae01f4b95e670abd9afc8d65a45f38012f8030cc

Successfully built subprocess32

Installing collected packages: pytz, six, backports.functools-lru-cache, pyparsing, python-dateutil, cycler, subprocess32, matplotlib

Successfully installed backports.functools-lru-cache-1.4 cycler-0.10.0 matplotlib-2.1.0 pyparsing-2.2.0 python-dateutil-2.6.1 pytz-2017.3 six-1.11.0 subprocess32-3.2.7

(PyMVPA) SimilarFacedeMacBook-Pro:PyMVPA similarface$ python

Python 2.7.10 (default, Jul 14 2015, 19:46:27)

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> from matplotlib import pylab

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "/Users/similarface/virtualenvs/PyMVPA/lib/python2.7/site-packages/matplotlib/pylab.py", line 257, in <module>

from matplotlib import cbook, mlab, pyplot as plt

File "/Users/similarface/virtualenvs/PyMVPA/lib/python2.7/site-packages/matplotlib/pyplot.py", line 113, in <module>

_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()

File "/Users/similarface/virtualenvs/PyMVPA/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 60, in pylab_setup

[backend_name], 0)

File "/Users/similarface/virtualenvs/PyMVPA/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 19, in <module>

from matplotlib.backends import _macosx

RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

>>>

(PyMVPA) SimilarFacedeMacBook-Pro:PyMVPA similarface$ cd ~/.matplotlib/

(PyMVPA) SimilarFacedeMacBook-Pro:.matplotlib similarface$ vi matplotlibrc

(PyMVPA) SimilarFacedeMacBook-Pro:.matplotlib similarface$ cat matplotlibrc

backend: TkAgg

(PyMVPA) SimilarFacedeMacBook-Pro:.matplotlib similarface$ python

Python 2.7.10 (default, Jul 14 2015, 19:46:27)

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> from matplotlib import pylab

>>> ^D

(PyMVPA) SimilarFacedeMacBook-Pro:.matplotlib similarface$

(PyMVPA) SimilarFacedeMacBook-Pro:.matplotlib similarface$

(PyMVPA) SimilarFacedeMacBook-Pro:.matplotlib similarface$

(PyMVPA) SimilarFacedeMacBook-Pro:.matplotlib similarface$

virtualenv下使用matplotlib的更多相关文章

  1. [python] virtualenv下解决matplotlib中文乱码

    1. 安装中文字体 一般系统自带wqy-microhei,其ttc文件位于/usr/share/fonts/truetype/wqy/wqy-microhei.ttc 2. 将ttc文件复制到pyth ...

  2. [django]在virtualenv下安装的第三方库的使用方法

    在virtualenv下安装的第三方库,例如south, requests等,如果想在django中使用,需要先将库添加到settings.py的INSTALLED_APPS中, 以south, re ...

  3. Ubuntu下用matplotlib作图时显示中文

    之前在Ubuntu下用matplotlib作图的时候发现无法正常显示中文,查了一番以后发现是Ubuntu系统和matplotlib库没有共同可显示的中文字体库的原因.用此文章的方法可以解决这一问题. ...

  4. 在tensorflow环境下安装matplotlib

    在运行程序时,报错ImportError: No module named 'matplotlib',如图.经网上查询发现是没有安装matplotlib 因此记录一下在tensorflow环境下安装m ...

  5. linux下,matplotlib遇到的相关问题以及解决方法

    1.在linux下运行matplotlib程序时,matplotlib的安装. 根据不同的linux系统继续相关安装: Debian / Ubuntu : sudo apt-get install p ...

  6. virtualenv下配置nginx uwsgi Django

    1.安装virtualenv,创建虚拟环境django15 sudo apt-get install virtualenv virtualenv env source bin/active pip i ...

  7. Python 在Windows下安装matplotlib

    windows下安装很麻烦,使用easy_install 安装报错  提示缺少freetype 和png 后经多方查询,最终安装成功 以下是安装过程 前提你的Python环境已经搭建好了 1.前提需要 ...

  8. 解决在Ubuntu系统下用matplotlib作图时出现中文乱码问题

    今天在jupyter notebook中画图时,中文不能正常显示,如下图所示: 在此记录一下解决的办法. 1.找到matplotlib配置文件的位置 import matplotlib print(m ...

  9. ubuntu下使用matplotlib绘图无法显示中文label

    原因是字体导致的.大家的做法基本都是搞一个windows上的字体文件(simhei.ttf, 点我fq下载)然后刷新一下缓存文件. 只不过百度搜到第一篇CSDN的博客,写的很不靠谱(不是所有的CSDN ...

随机推荐

  1. 【pb_ds】【平衡树启发式合并】【并查集】bzoj2733 [HNOI2012]永无乡

    用并查集维护联通性.对每个联通块维护一个平衡树.合并时启发式合并.比较懒,用了pb_ds. #include<cstdio> #include<ext/pb_ds/assoc_con ...

  2. [CF773D]Perishable Roads

    [CF773D]Perishable Roads 题目大意: 一个\(n(n\le2000)\)个点的完全图\(G\),定义\(d(x)\)为生成树上点\(x\)到根路径上的最小边权.问图\(G\)的 ...

  3. 【MySQL笔记】数据操纵语言DML

    1.数据插入   INSERT INTO table_name (列1, 列2,...) VALUES(值1, 值2,....),(第二条),(第三条)...   注: 1)如果表中的每一列均有数据插 ...

  4. 输入格式CombineFileInput

    此输入格式的作用就是可以将来自多个不同文件的物理块作为一个split,然后由一个map进行处理. http://www.blogjava.net/shenh062326/archive/2012/07 ...

  5. IO流--FileReader&&FileWriter

    (一)FileReader (1)第一种读取方式 package com.songyan.fileReader; import java.io.FileNotFoundException; impor ...

  6. Douglas Peucker算法的C#实现

    一.算法原理 Douglas-Peucker算法 在数字化过程中,需要对曲线进行采样简化,即在曲线上取有限个点,将其变为折线,并且能够在一定程度 上保持原有的形状. 经典的Douglas-Peucke ...

  7. Integrating Google Sign-In into Your Android App

    To integrate Google Sign-In into your Android app, configure Google Sign-In and add a button to your ...

  8. libCurl 简单使用

    curl easy  的使用步骤 curl_easy_init() curl_easy_setopt() curl_easy_perform() curl_easy_cleanup() ------- ...

  9. NET PROVIDER 连接 Oracle数据库

    NET 数据库连接 ORacle      http://www.devart.com/ DataDirect   http://www.datadirect.com/ Oracle免客户端For . ...

  10. easyui datagrid加载成功之后选定并获取首行数据

    //加载成功之后,选定并获取首行数据 onLoadSuccess:function(data){ alert("grid加载成功"); var rows=$('test').dat ...