在aliyun linux 上,安装caravel,创建admin用户时报 unable to import caravel Error: invalid syntax (views.py, line 613)
根据官网文档,在aliyun linux 上安装caravel,在执行fabmanager create-admin --app caravel命令,录入邮箱后,出现问题:
Added Permission menu access on Permission on Views/Menus to role Admin Was unable to import caravel Error: invalid syntax (views.py, line 613)
----请教大神怎么解决?不会python,难道要改views.py的代码吗?
--------------------安装过程如下---------------------
os:aliyun linux
1.执行yum upgrade python-setuptools失败,直接官网下载setuptools-20.7.0,安装
2.执行yum install gcc libffi-devel python-devel python-pip python-wheel openssl-devel报错
强制安装nose ,$ pip install -U --force --user nose
3.继续按官网说明操作,一直到这步:fabmanager create-admin --app caravel
--------------------详细日志如下---------------------
[root@iZ11sfabwfoZ ~]# fabmanager create-admin --app caravel
Username [admin]: wabomo
User first name [admin]: bomo
User last name [user]: wang
Email [admin@fab.org]: wabomo@163.com
Password:
Repeat for confirmation:
/usr/lib/python2.6/site-packages/flask_cache/__init__.py:152: UserWarning: Flask-Cache: CACHE_TYPE is set to null, caching is effectively disabled.
warnings.warn("Flask-Cache: CACHE_TYPE is set to null, "
2016-04-15 11:25:29,278:INFO:flask_appbuilder.security.sqla.manager:Security DB not found Creating all Models from Base
2016-04-15 11:25:29,324:INFO:flask_appbuilder.security.sqla.manager:Security DB Created
2016-04-15 11:25:29,332:INFO:flask_appbuilder.security.sqla.manager:Inserted Role: Admin
2016-04-15 11:25:29,339:INFO:flask_appbuilder.security.sqla.manager:Inserted Role: Public
2016-04-15 11:25:29,341:WARNING:flask_appbuilder.security.manager:No user yet created, use fabmanager command to do it.
2016-04-15 11:25:29,342:INFO:flask_appbuilder.base:Registering class MyIndexView on menu
2016-04-15 11:25:29,354:INFO:flask_appbuilder.base:Registering class UtilView on menu
2016-04-15 11:25:29,363:INFO:flask_appbuilder.base:Registering class LocaleView on menu
2016-04-15 11:25:29,371:INFO:flask_appbuilder.base:Registering class ResetPasswordView on menu
2016-04-15 11:25:29,398:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can this form post on ResetPasswordView
2016-04-15 11:25:29,411:INFO:flask_appbuilder.security.sqla.manager:Added Permission can this form post on ResetPasswordView to role Admin
2016-04-15 11:25:29,427:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can this form get on ResetPasswordView
2016-04-15 11:25:29,443:INFO:flask_appbuilder.security.sqla.manager:Added Permission can this form get on ResetPasswordView to role Admin
2016-04-15 11:25:29,444:INFO:flask_appbuilder.base:Registering class ResetMyPasswordView on menu
2016-04-15 11:25:29,464:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can this form post on ResetMyPasswordView
2016-04-15 11:25:29,476:INFO:flask_appbuilder.security.sqla.manager:Added Permission can this form post on ResetMyPasswordView to role Admin
2016-04-15 11:25:29,488:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can this form get on ResetMyPasswordView
2016-04-15 11:25:29,501:INFO:flask_appbuilder.security.sqla.manager:Added Permission can this form get on ResetMyPasswordView to role Admin
2016-04-15 11:25:29,502:INFO:flask_appbuilder.base:Registering class UserInfoEditView on menu
2016-04-15 11:25:29,520:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can this form post on UserInfoEditView
2016-04-15 11:25:29,535:INFO:flask_appbuilder.security.sqla.manager:Added Permission can this form post on UserInfoEditView to role Admin
2016-04-15 11:25:29,546:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can this form get on UserInfoEditView
2016-04-15 11:25:29,559:INFO:flask_appbuilder.security.sqla.manager:Added Permission can this form get on UserInfoEditView to role Admin
2016-04-15 11:25:29,559:INFO:flask_appbuilder.base:Registering class AuthDBView on menu
2016-04-15 11:25:29,572:INFO:flask_appbuilder.base:Registering class UserDBModelView on menu List Users
2016-04-15 11:25:29,601:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can edit on UserDBModelView
2016-04-15 11:25:29,613:INFO:flask_appbuilder.security.sqla.manager:Added Permission can edit on UserDBModelView to role Admin
2016-04-15 11:25:29,628:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can userinfo on UserDBModelView
2016-04-15 11:25:29,641:INFO:flask_appbuilder.security.sqla.manager:Added Permission can userinfo on UserDBModelView to role Admin
2016-04-15 11:25:29,659:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can delete on UserDBModelView
2016-04-15 11:25:29,671:INFO:flask_appbuilder.security.sqla.manager:Added Permission can delete on UserDBModelView to role Admin
2016-04-15 11:25:29,689:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can download on UserDBModelView
2016-04-15 11:25:29,701:INFO:flask_appbuilder.security.sqla.manager:Added Permission can download on UserDBModelView to role Admin
2016-04-15 11:25:29,716:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can list on UserDBModelView
2016-04-15 11:25:29,727:INFO:flask_appbuilder.security.sqla.manager:Added Permission can list on UserDBModelView to role Admin
2016-04-15 11:25:29,747:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can add on UserDBModelView
2016-04-15 11:25:29,761:INFO:flask_appbuilder.security.sqla.manager:Added Permission can add on UserDBModelView to role Admin
2016-04-15 11:25:29,780:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can show on UserDBModelView
2016-04-15 11:25:29,793:INFO:flask_appbuilder.security.sqla.manager:Added Permission can show on UserDBModelView to role Admin
2016-04-15 11:25:29,811:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: resetmypassword on UserDBModelView
2016-04-15 11:25:29,825:INFO:flask_appbuilder.security.sqla.manager:Added Permission resetmypassword on UserDBModelView to role Admin
2016-04-15 11:25:29,842:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: resetpasswords on UserDBModelView
2016-04-15 11:25:29,854:INFO:flask_appbuilder.security.sqla.manager:Added Permission resetpasswords on UserDBModelView to role Admin
2016-04-15 11:25:29,877:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: userinfoedit on UserDBModelView
2016-04-15 11:25:29,889:INFO:flask_appbuilder.security.sqla.manager:Added Permission userinfoedit on UserDBModelView to role Admin
2016-04-15 11:25:29,914:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: menu access on List Users
2016-04-15 11:25:29,925:INFO:flask_appbuilder.security.sqla.manager:Added Permission menu access on List Users to role Admin
2016-04-15 11:25:29,944:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: menu access on Security
2016-04-15 11:25:29,959:INFO:flask_appbuilder.security.sqla.manager:Added Permission menu access on Security to role Admin
2016-04-15 11:25:29,961:INFO:flask_appbuilder.base:Registering class RoleModelView on menu List Roles
2016-04-15 11:25:29,983:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can edit on RoleModelView
2016-04-15 11:25:29,995:INFO:flask_appbuilder.security.sqla.manager:Added Permission can edit on RoleModelView to role Admin
2016-04-15 11:25:30,004:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can delete on RoleModelView
2016-04-15 11:25:30,017:INFO:flask_appbuilder.security.sqla.manager:Added Permission can delete on RoleModelView to role Admin
2016-04-15 11:25:30,026:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can download on RoleModelView
2016-04-15 11:25:30,043:INFO:flask_appbuilder.security.sqla.manager:Added Permission can download on RoleModelView to role Admin
2016-04-15 11:25:30,053:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can list on RoleModelView
2016-04-15 11:25:30,065:INFO:flask_appbuilder.security.sqla.manager:Added Permission can list on RoleModelView to role Admin
2016-04-15 11:25:30,075:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can add on RoleModelView
2016-04-15 11:25:30,087:INFO:flask_appbuilder.security.sqla.manager:Added Permission can add on RoleModelView to role Admin
2016-04-15 11:25:30,097:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can show on RoleModelView
2016-04-15 11:25:30,109:INFO:flask_appbuilder.security.sqla.manager:Added Permission can show on RoleModelView to role Admin
2016-04-15 11:25:30,125:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: Copy Role on RoleModelView
2016-04-15 11:25:30,137:INFO:flask_appbuilder.security.sqla.manager:Added Permission Copy Role on RoleModelView to role Admin
2016-04-15 11:25:30,156:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: menu access on List Roles
2016-04-15 11:25:30,169:INFO:flask_appbuilder.security.sqla.manager:Added Permission menu access on List Roles to role Admin
2016-04-15 11:25:30,177:INFO:flask_appbuilder.base:Registering class UserStatsChartView on menu User's Statistics
2016-04-15 11:25:30,203:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can chart on UserStatsChartView
2016-04-15 11:25:30,216:INFO:flask_appbuilder.security.sqla.manager:Added Permission can chart on UserStatsChartView to role Admin
2016-04-15 11:25:30,237:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: menu access on User's Statistics
2016-04-15 11:25:30,250:INFO:flask_appbuilder.security.sqla.manager:Added Permission menu access on User's Statistics to role Admin
2016-04-15 11:25:30,257:INFO:flask_appbuilder.base:Registering class PermissionModelView on menu Base Permissions
2016-04-15 11:25:30,280:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can list on PermissionModelView
2016-04-15 11:25:30,292:INFO:flask_appbuilder.security.sqla.manager:Added Permission can list on PermissionModelView to role Admin
2016-04-15 11:25:30,315:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: menu access on Base Permissions
2016-04-15 11:25:30,328:INFO:flask_appbuilder.security.sqla.manager:Added Permission menu access on Base Permissions to role Admin
2016-04-15 11:25:30,335:INFO:flask_appbuilder.base:Registering class ViewMenuModelView on menu Views/Menus
2016-04-15 11:25:30,357:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can list on ViewMenuModelView
2016-04-15 11:25:30,369:INFO:flask_appbuilder.security.sqla.manager:Added Permission can list on ViewMenuModelView to role Admin
2016-04-15 11:25:30,388:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: menu access on Views/Menus
2016-04-15 11:25:30,403:INFO:flask_appbuilder.security.sqla.manager:Added Permission menu access on Views/Menus to role Admin
2016-04-15 11:25:30,413:INFO:flask_appbuilder.base:Registering class PermissionViewModelView on menu Permission on Views/Menus
2016-04-15 11:25:30,435:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: can list on PermissionViewModelView
2016-04-15 11:25:30,448:INFO:flask_appbuilder.security.sqla.manager:Added Permission can list on PermissionViewModelView to role Admin
2016-04-15 11:25:30,469:INFO:flask_appbuilder.security.sqla.manager:Created Permission View: menu access on Permission on Views/Menus
2016-04-15 11:25:30,484:INFO:flask_appbuilder.security.sqla.manager:Added Permission menu access on Permission on Views/Menus to role Admin
Was unable to import caravel Error: invalid syntax (views.py, line 613)
------------------------------------------------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
使用python3.6,安装它,但是在执行fabmanager create-admin --app superset时候报错:
Was unable to import superset Error: module 'xml.etree.ElementTree' has no attribute '_IterParseIterator'
官方安装说明页第一行就写得很明确,只支持2.7,2.6不行。升级版本吧。
Caravel is currently only tested using Python 2.7.*. Python 3 support is on the roadmap, Python 2.6 won’t be supported.
执行fabmanager create-admin --app caravel 报错: raise DistributionNotFound(req) pkg_resources.DistributionNotFound: Flask-WTF>=0.9.1
可以跑起来,我已经部署了一个
主要检查cryptography、pandas是否安装成功,没成功要手动安装,cryptography不支持python2.6
可能是python的版本太低了,aliyun linux自带的是2.6.6的python,正在升级
在搞其它事,没把安装过程发上来,现在补下
-----------先看一下官方文档操作-------------
1> aliyun linux对应的是这块系统依赖安装命令:
yum upgrade python-setuptools
yum install gcc libffi-devel python-devel python-pip python-wheel openssl-devel
2> 安装caravel及其样例
# Install caravel
pip install caravel
# Create an admin user
fabmanager create-admin --app caravel
# Initialize the database
caravel db upgrade
# Create default roles and permissions
caravel init
# Load some data to play with
caravel load_examples
# Start the development web server
caravel runserver -d
-------------安装成功的过程记录-------------
1.安装python2.7(系统自带python版本太低2.6.6,caravel需要2.7版)
2.安装pip
pip下载页面https://pypi.python.org/pypi/pip
$ wget https://pypi.python.org/packages/source/p/pip/pip-7.1.0.tar.gz
$ cd pip-7.1.0
$ python setup.py install
3.安装setuptools
$ wget https://pypi.python.org/packages/source/s/setuptools/setuptools-20.7.0.tar.gz
$ tar -zxvf setuptools-20.7.0.tar.gz
$ cd setuptools-20.7.0
$ python setup.py install
4、根据官方文档操作,在执行到fabmanager create-admin --app caravel时,提示:fabmanager not found
将fab添加至PATH变量中,
$ export PATH=$PATH:/usr/local/python2.7/bin
若没安装fab,下载解压安装后,再添加
$ wget https://pypi.python.org/packages/source/f/fab/fab-1.4.2.tar.gz#md5=45b945bdde70995868ef1497664a11d7
$ tar -zxvf fab-1.4.2.tar.gz
$ cd fab-1.4.2
$ python setup.py install
5、继续官方文档操作,一路畅通