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 ...
随机推荐
- [BZOJ4538]网络
今天打比赛,毒瘤yww把这题出到$n,m\leq 5\times10^5$,因为不会写整体二分所以来写坑爹的$O\left(n\log_2n\right)$做法 考虑按重要度建权值线段树(相同权值的请 ...
- 【分治】计算概论(A) / 函数递归练习(1)多边形游戏
#include<cstdio> #include<algorithm> using namespace std; ],c[],s[]; int work(int L,int ...
- 【二分答案】bzoj1639 [Usaco2007 Mar]Monthly Expense 月度开支
#include<cstdio> using namespace std; #define N 100001 int n,m,a[N]; bool check(int x) { int n ...
- Problem Q: 零起点学算法12——求2个日期之间的天数
#include<stdio.h> int main() { int a1,b1,c1,a2,b2,c2,s; scanf("%d-%d-%d",&a1,&am ...
- 【MySQL笔记】SQL语言四大类语言
SQL语言共分为四大类:数据查询语言DQL,数据操纵语言DML,数据定义语言DDL,数据控制语言DCL. 1. 数据查询语言DQL 数据查询语言DQL基本结构是由SELECT子句,FROM子句, ...
- 文件描述符与socket连接
每个进程开启一个soeket连接,都会占用一个文件描述符. 1. 概述 在Linux系统中一切皆可以看成是文件,文件又可分为:普通文件.目录文件.链接文件和设备文件. 文件 ...
- python函数中的关键字参数
关键字参数: 就是在形式参数中必须要提供”传递参数名=传递参数值” 位置参数: 仅仅只有参数名 特点:1.位置参数只能出现在关键字参数之前,不管是在行参还是实参中. 2.关键字参数在调用时(实参)中 ...
- XAMPP安装与多虚拟目录地址设置
前端开发集成环境-XAMPP 在前端开发中,经常需要进行请求的调试等都需要一个服务器环境,这时类似wamp.XAMPP就是我们最后的选择,集成apache.php.mysql等一应俱全,不需要去单独配 ...
- WebHelper-SessionHelper、CookieHelper、CacheHelper、Tree
ylbtech-Unitity: cs-WebHelper-SessionHelper.CookieHelper.CacheHelper.Tree SessionHelper.cs CookieHel ...
- 最简单的PHP socket
服务端 <?phperror_reporting(E_ALL);set_time_limit(0); $ip = "127.0.0.1";$port = 1935; func ...