FeeiCN/Cobra

Python2环境运行Cobra出错

yangyang-zhang opened this issue · 3 comments

System and Python Environment

Item Tooltip Value
System Linux localhost 3.10.0-327.4.5.el7.x86_64 #1 SMP Mon Jan 25 22:07:14 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Python 2.7.5
Cobra python cobra.py

Description

[Description of the bug or feature]
[root@localhost cobra]# python cobra.py
Traceback (most recent call last):
File "cobra.py", line 18, in
from cobra import main
File "/home/yangyang_zhang/cobra/cobra/init.py", line 22, in
from . import cli, api, config
File "/home/yangyang_zhang/cobra/cobra/api.py", line 27, in
from flask import Flask, request, render_template, Blueprint
File "/usr/lib/python2.7/site-packages/flask/init.py", line 21, in
from .app import Flask, Request, Response
File "/usr/lib/python2.7/site-packages/flask/app.py", line 23, in
from werkzeug.routing import BuildError, Map, RequestRedirect, Rule
File "/usr/lib/python2.7/site-packages/werkzeug/routing.py", line 948
exec(code, globs, locs)
SyntaxError: unqualified exec is not allowed in function '_compile_builder' it contains a nested function with free variables

升级一下python到3.0版本的就可以了

我也遇到这个问题了,看来readme上面写的支持2.7是错的了。

我也遇到这个问题了,看来readme上面写的支持2.7是错的了。

是的,readme里写的可能不太对,并不支持Python2.7