安装基础包:yum groupinstall "Development tools"
一、pip安装1. 安装python
需要2.7版本的Python,如果centOS自带的是2.7的则不需安装(centOS7自带了2.7.5) ② 解压 ③ 编译安装 # ./configure --prefix=/usr/local
2. 安装pip
首先
3. 安装caravel
① 获得caravel源码
4. 错误(如果有错误执行下面的)
① cffi yum install openssl
二、nmp安装1. 安装nodejs下载node-v4.5.0.tar.gz(官网)解压
# ./configure --prefix=/usr/local
2. 安装npm
根据网址下载 install.sh (https://npmjs.org/install.sh) 3. 安装express# npm install express -g
4. 安装caravel(源码安装)
## assuming $CARAVEL_HOME as the root of the repo
三、初始化运行创建admin用户# fabmanager create-admin --app caravel 初始化caravel元数据 # caravel db upgrade 初始化caravel默认的用户角色和权限 # caravel init 加载示例数据 # caravel load_examples 定义运行端口 # caravel runserver -p 8088 通过http://localhost:8088就可访问
四、连接数据源
1. postgresql
yum install build-dep python-psycopg2 pip install psycopg2 2. mysql yum install MySQL-python
linux环境下安装MySQL-python的两种方式
第一种 简单:yum install MySQL-python 第二种:复杂:需要自己源码编译,依赖包比较多 a. gcc b. setuptools c. python-dev
第二章详细步骤如下:
A.下载:wget http://sourceforge.net/projects/mysql-python/files/latest/download
B.
$ tar xfz MySQL-python-1.2.3.tar.gz
$ cd MySQL-python-1.2.3
$whereis mysql_config
mysql_config: /usr/bin/mysql_config
$ vim site.cfg 修改mysql_config为mysql配置文件的路径 /usr/bin/mysql_config
还要修改
threadsafe = False
$ python setup.py build $ sudo python setup.py install
在python环境下
>>> import MySQLdb
/usr/local/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/_mysql.py:3: UserWarning: Module _mysql was already imported from /usr/local/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/_mysql.pyc, but /app/MySQL-python-1.2.5 is being added to sys.path
安装成功
-------------------------------------------------------------------------------------------------------------------------------
安装过程中报,error: command 'gcc' failed with exit status 1
用yum install gcc 显示已经是安装最新版本
未安装mysql-devel包
解决方法:yum install mysql-devel
参考地址:http://blog.csdn.net/wklken/article/details/7271019
http://blog.csdn.net/agoago_2009/article/details/9492765
参考文件 http://www.aboutyun.com/thread-19402-1-1.html http://blog.csdn.net/csulfy/article/details/51833407 http://lxw1234.com/archives/2016/06/681.htm http://km-moon11.iteye.com/blog/2213527 http://airbnb.io/caravel/installation.html (责任编辑:IT) |