Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Python2环境运行Cobra出错 #1380

Open
yangyang-zhang opened this issue Aug 27, 2019 · 3 comments
Open

Python2环境运行Cobra出错 #1380

yangyang-zhang opened this issue Aug 27, 2019 · 3 comments

Comments

@yangyang-zhang
Copy link

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

@blockchainguard
Copy link

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

@hack2012
Copy link

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

@yangyang-zhang
Copy link
Author

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants