解决python在本机Mac上出错:RuntimeError: Python is not installed as a framework.
来源:互联网 发布:弱电设计软件 编辑:程序博客网 时间:2024/05/22 00:48
一. 问题现象:
调用库:#import matplotlib.pyplot as plt
弹出错误提示:
from matplotlib.backends import _macosx RuntimeError: Python is not installed as a framework. TheMac OS X backend will not be able to function correctly if Pythonis not installed as a framework. See the Python documentation formore 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.二.问题解决
==================================
2014-01-10 (注) 原方案存在问题:在安装cx_Freeze-4.3.2的时候,无法找到需要的库文件.
在Python3.3的源码包里面,有ReadMe文件,里面有段话:
31 On Mac OS X, if you have configured Python with --enable-framework, you should
32 use "make frameworkinstall" to do the installation. Note that this installs the
33 Python executable in a place that is not normally on your PATH, you may want to
34 set up a symlink in /usr/local/bin.
所以,解决办法是:
./configure --enable-framework
sudo make frameworkinstall
sudo make install
==================================
(1) 安装python3.3后,按照如下文章内容操作
http://www.chenwg.com/python/%E6%9B%B4%E6%96%B0mac%E8%87%AA%E5%B8%A6%E7%9A%84python.html
或者
http://blog.richieliu.com/
(2) 删除其他目录下的python
(3)过程中曾经尝试:修改配置文件 matplotlibrc.
locate该文件并拷贝到~/.matplotlib/ 目录下进行编辑.
但本机仍然失败,因为依赖其他文件(库).
因此决定采用(1)(2)中方案,最终成功.
三. 原因分析和资料索引
(1) 本机上有2个python3.3,一个在/opt下,一个在/usr/bin下. 删除/opt下python结果OK.
猜测:每次调用都是跑到/opt下的python,导致出错.
rm -rf /opt/local/Library/Frameworks/Python.framework/
(2) 正确的python运行目录
/System/Library/Frameworks/Python.framework/Versions/3.3/bin/python3
(3) matplot运行(傅里叶变换)所需库文件列表:
Python-3.3.3
FFT-tools
lxml-3.2.4
matplotlib-1.3.1
nose-1.3.0
numpy-1.8.0
pyparsing-2.0.1
python-dateutil-2.1
setuptools-1.4
six-1.4.1
tornado-3.1.1
- 解决python在本机Mac上出错:RuntimeError: Python is not installed as a framework.
- Mac使用 matplotlib 画图 => RuntimeError: Python is not installed as a framework
- Python is not installed as a framework. The Mac OS X backend will not be a
- 【python】解决Linter pylint is not installed
- mac上 python 安装lxml失败Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed
- Python: The _imagingft C module is not installed错误的解决
- Python 的PIL,可以解决ImportError The _imagingft C module is not installed
- python中PIL库在使用时出现The _imagingft C module is not installed错误
- python PIL ImportError: The _imagingft C module is not installed
- Anaconda安装MySQL Python 3.4 is not installed
- Python RuntimeError: thread.__init__() not called
- QtQuick程序在ubuntu测试机上运行提示module "QtQuick.Controls" is not installed
- Win10安装Python出错: there is a problem with widows installer package,a program run as part of setup di
- python:multiprocessing 在windows中的使用:RuntimeError:
- python中pip安装出现is not a support wheel on is platform问题的解决
- Installed Flash Player Is Not a Debugger
- Mac上HAX is not installed on this machine 的解决办法
- Mac上HAX is not installed on this machine 的解决办法
- 读取属性文件
- Eclipse快捷键 10个最有用的快捷键
- hdu 1075 What Are You Talking About
- IOS系列——Tabbarcontroller的含义
- 不用加减乘除做加法
- 解决python在本机Mac上出错:RuntimeError: Python is not installed as a framework.
- adb的使用
- UVA 10034 - Freckles(最小生成树)
- Ubuntu-10.10如何给用户添加sudo权限
- Windos下Android(ADT Bundle)配置NDK的两种方法------ADT、Cygwin、NDK配置汇总
- 我与大家分享一下手机内存卡照片恢复的相关信息
- xx.rc windows资源文件的定义和使用
- shell 中export变量导出到子进程
- 4大 Java OSGi 框架比较 (Knopflerfish, Apache Felix, Equinox, Spring DM)