virtualenv下使用matplotlib
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的更多相关文章
- [python] virtualenv下解决matplotlib中文乱码
1. 安装中文字体 一般系统自带wqy-microhei,其ttc文件位于/usr/share/fonts/truetype/wqy/wqy-microhei.ttc 2. 将ttc文件复制到pyth ...
- [django]在virtualenv下安装的第三方库的使用方法
在virtualenv下安装的第三方库,例如south, requests等,如果想在django中使用,需要先将库添加到settings.py的INSTALLED_APPS中, 以south, re ...
- Ubuntu下用matplotlib作图时显示中文
之前在Ubuntu下用matplotlib作图的时候发现无法正常显示中文,查了一番以后发现是Ubuntu系统和matplotlib库没有共同可显示的中文字体库的原因.用此文章的方法可以解决这一问题. ...
- 在tensorflow环境下安装matplotlib
在运行程序时,报错ImportError: No module named 'matplotlib',如图.经网上查询发现是没有安装matplotlib 因此记录一下在tensorflow环境下安装m ...
- linux下,matplotlib遇到的相关问题以及解决方法
1.在linux下运行matplotlib程序时,matplotlib的安装. 根据不同的linux系统继续相关安装: Debian / Ubuntu : sudo apt-get install p ...
- virtualenv下配置nginx uwsgi Django
1.安装virtualenv,创建虚拟环境django15 sudo apt-get install virtualenv virtualenv env source bin/active pip i ...
- Python 在Windows下安装matplotlib
windows下安装很麻烦,使用easy_install 安装报错 提示缺少freetype 和png 后经多方查询,最终安装成功 以下是安装过程 前提你的Python环境已经搭建好了 1.前提需要 ...
- 解决在Ubuntu系统下用matplotlib作图时出现中文乱码问题
今天在jupyter notebook中画图时,中文不能正常显示,如下图所示: 在此记录一下解决的办法. 1.找到matplotlib配置文件的位置 import matplotlib print(m ...
- ubuntu下使用matplotlib绘图无法显示中文label
原因是字体导致的.大家的做法基本都是搞一个windows上的字体文件(simhei.ttf, 点我fq下载)然后刷新一下缓存文件. 只不过百度搜到第一篇CSDN的博客,写的很不靠谱(不是所有的CSDN ...
随机推荐
- Codeforces 786A Berzerk(博弈论)
[题目链接] http://codeforces.com/problemset/problem/786/A [题目大意] 有两个人,每个人有一个数集,里面有一些数,现在有一个环,有个棋子放在1, 有个 ...
- Linux中安装MySql 5.7.21的详细操作步骤
一:到mysql官网下载最新的mysql包 mysql-5.7.21-linux-glibc2.12-x86_64 官方下载地址:https://dev.mysql.com/downloads/mys ...
- Java高级架构师(一)第28节:Index、商品详细页和购物车
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding= ...
- DOM系统学习-表格、样式和元素大小
操作表格 属性: caption 标题元素 tHead 表头元素 tFoot 表尾元素 tBodies 主体元素集合,通过下标取 row 行元素集合,通过下标取 方法 ...
- MAC下安装Mysql数据库
步骤一:安装 登录官网:mysql数据库下载官网下载合适的版本 下载完成后,在Finder的侧边栏为下载的目录中,找到下载完成的文档. 单击下载文档,单击MySQL-5.6.22-osx10.8-x8 ...
- 爪哇国新游记之二十八----从url指定的地址下载文件到本地
package download; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; ...
- html5学习整理-0311
整理一下今天所学的一些标签内容. 首先说一下DNS:全称Domain Name System,域名系统.是因特网上作为域名和IP地址相互映射的一个分布式数据库. URL协议:规定URL地址的格式,UR ...
- Java Volatile keyword
Volatile修饰的成员变量在每次被线程訪问时,都强迫从主内存中重读该成员变量的值.并且,当成员变量发生变化时,强迫线程将变化值回写到主内存.这样在不论什么时刻,两个不同的线程总是看到某个成员变量的 ...
- javascript - 闭包之一些常见的写法
/** * 防御型分号 */ ; (function () { //code.... console.log('一开始,我自己执行了!!!'); })(); /** * 形参 -> 实参 * 定 ...
- Android自己定义button实现长按功能
Android自己定义button实现长按功能 通过自己定义BUTTON,写一个LongTouchBtn类,在按下的时候运行onTouchEvent事件,通过这个事件使用回调函数来实现长按功能! XM ...