librelist archives

« back to archive

syntax error at __init__.py?

syntax error at __init__.py?

From:
LiChao
Date:
2010-11-18 @ 08:51
Hi all:

I met an error while importing the flask:
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
line 18
    from .app import Flask, Request, Response
         ^
SyntaxError: invalid syntax

I gooled but no result, why this, please help.

Here is the detail info:


-bash-3.2$ cat /etc/issue
CentOS release 5.5 (Final)
Kernel \r on an \m


-bash-3.2$ python
Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
line 18
    from .app import Flask, Request, Response
         ^
SyntaxError: invalid syntax
>>>
-bash-3.2$


BR
11/18/2010

Re: [flask] syntax error at __init__.py?

From:
Jonas Galvez
Date:
2010-11-18 @ 08:54
LiChao wrote:
> "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> line 18
>     from .app import Flask, Request, Response
>          ^
> SyntaxError: invalid syntax

The intra-package references (module names starting with a dot) which
Flask uses were only added in Python 2.5. You're using 2.4.

-- Jonas

syntax error at __init__.py?

From:
LiChao
Date:
2010-11-18 @ 08:52
Hi all:

I met an error while importing the flask:
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
line 18
    from .app import Flask, Request, Response
         ^
SyntaxError: invalid syntax

I gooled but no result, why this, please help.

Here is the detail info:


-bash-3.2$ cat /etc/issue
CentOS release 5.5 (Final)
Kernel \r on an \m


-bash-3.2$ python
Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import flask
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
line 18
    from .app import Flask, Request, Response
         ^
SyntaxError: invalid syntax
>>>
-bash-3.2$


BR
11/18/2010

Re: [flask] syntax error at __init__.py?

From:
danjac354@gmail.com
Date:
2010-11-18 @ 08:54
You're using Python 2.4. Relative imports using the "dot" syntax were
introduced in 2.5. Upgrade to Python 2.5 or if that isn't possible
then run your Flask apps inside virtualenv.

http://docs.python.org/whatsnew/2.5.html#pep-328-absolute-and-relative-imports
http://pypi.python.org/pypi/virtualenv


On 18 November 2010 08:52, LiChao <sockpuppet.lea@gmail.com> wrote:
> Hi all:
>
> I met an error while importing the flask:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
> "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> line 18
>     from .app import Flask, Request, Response
>          ^
> SyntaxError: invalid syntax
>
> I gooled but no result, why this, please help.
>
> Here is the detail info:
>
>
> -bash-3.2$ cat /etc/issue
> CentOS release 5.5 (Final)
> Kernel \r on an \m
>
>
> -bash-3.2$ python
> Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import flask
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
> "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> line 18
>     from .app import Flask, Request, Response
>          ^
> SyntaxError: invalid syntax
>>>>
> -bash-3.2$
>
>
> BR
> 11/18/2010
>
>
>

Re: [flask] syntax error at __init__.py?

From:
LiChao
Date:
2010-11-18 @ 10:52
virtualenv works! thanks.

BR.
Liszt
11/18/2010

On Thu, Nov 18, 2010 at 4:54 PM, danjac354@gmail.com <danjac354@gmail.com>wrote:

> You're using Python 2.4. Relative imports using the "dot" syntax were
> introduced in 2.5. Upgrade to Python 2.5 or if that isn't possible
> then run your Flask apps inside virtualenv.
>
>
> http://docs.python.org/whatsnew/2.5.html#pep-328-absolute-and-relative-imports
> http://pypi.python.org/pypi/virtualenv
>
>
> On 18 November 2010 08:52, LiChao <sockpuppet.lea@gmail.com> wrote:
> > Hi all:
> >
> > I met an error while importing the flask:
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> > line 18
> >     from .app import Flask, Request, Response
> >          ^
> > SyntaxError: invalid syntax
> >
> > I gooled but no result, why this, please help.
> >
> > Here is the detail info:
> >
> >
> > -bash-3.2$ cat /etc/issue
> > CentOS release 5.5 (Final)
> > Kernel \r on an \m
> >
> >
> > -bash-3.2$ python
> > Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
> > [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import flask
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> > line 18
> >     from .app import Flask, Request, Response
> >          ^
> > SyntaxError: invalid syntax
> >>>>
> > -bash-3.2$
> >
> >
> > BR
> > 11/18/2010
> >
> >
> >
>

Re: [flask] syntax error at __init__.py?

From:
Thomas Beugin
Date:
2010-11-18 @ 08:54
Hi ,

from flask import Flask, Request, Response

You can try this?

Cordialement,
Beugin Thomas



2010/11/18 LiChao <sockpuppet.lea@gmail.com>:
> Hi all:
>
> I met an error while importing the flask:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
> "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> line 18
>     from .app import Flask, Request, Response
>          ^
> SyntaxError: invalid syntax
>
> I gooled but no result, why this, please help.
>
> Here is the detail info:
>
>
> -bash-3.2$ cat /etc/issue
> CentOS release 5.5 (Final)
> Kernel \r on an \m
>
>
> -bash-3.2$ python
> Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import flask
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File
> "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> line 18
>     from .app import Flask, Request, Response
>          ^
> SyntaxError: invalid syntax
>>>>
> -bash-3.2$
>
>
> BR
> 11/18/2010
>
>
>

Re: [flask] syntax error at __init__.py?

From:
danjac354@gmail.com
Date:
2010-11-18 @ 09:00
I should have said "update to *at least* Python 2.5". Flask will of
course run on newer versions of Python 2.x, and it's better to have
the latest stable version (2.7).

On 18 November 2010 08:54, Thomas Beugin <kimkof@gmail.com> wrote:
> Hi ,
>
> from flask import Flask, Request, Response
>
> You can try this?
>
> Cordialement,
> Beugin Thomas
>
>
>
> 2010/11/18 LiChao <sockpuppet.lea@gmail.com>:
>> Hi all:
>>
>> I met an error while importing the flask:
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>>   File
>> "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
>> line 18
>>     from .app import Flask, Request, Response
>>          ^
>> SyntaxError: invalid syntax
>>
>> I gooled but no result, why this, please help.
>>
>> Here is the detail info:
>>
>>
>> -bash-3.2$ cat /etc/issue
>> CentOS release 5.5 (Final)
>> Kernel \r on an \m
>>
>>
>> -bash-3.2$ python
>> Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
>> [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import flask
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in ?
>>   File
>> "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
>> line 18
>>     from .app import Flask, Request, Response
>>          ^
>> SyntaxError: invalid syntax
>>>>>
>> -bash-3.2$
>>
>>
>> BR
>> 11/18/2010
>>
>>
>>
>

Re: [flask] syntax error at __init__.py?

From:
LiChao
Date:
2010-11-18 @ 08:59
nope, still not work, I'll try to install a py25 on my local.

On Thu, Nov 18, 2010 at 4:54 PM, Thomas Beugin <kimkof@gmail.com> wrote:

> Hi ,
>
> from flask import Flask, Request, Response
>
> You can try this?
>
> Cordialement,
> Beugin Thomas
>
>
>
> 2010/11/18 LiChao <sockpuppet.lea@gmail.com>:
> > Hi all:
> >
> > I met an error while importing the flask:
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> > line 18
> >     from .app import Flask, Request, Response
> >          ^
> > SyntaxError: invalid syntax
> >
> > I gooled but no result, why this, please help.
> >
> > Here is the detail info:
> >
> >
> > -bash-3.2$ cat /etc/issue
> > CentOS release 5.5 (Final)
> > Kernel \r on an \m
> >
> >
> > -bash-3.2$ python
> > Python 2.4.3 (#1, Nov 11 2010, 13:34:43)
> > [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >>>> import flask
> > Traceback (most recent call last):
> >   File "<stdin>", line 1, in ?
> >   File
> > "/usr/lib/python2.4/site-packages/Flask-0.6-py2.4.egg/flask/__init__.py",
> > line 18
> >     from .app import Flask, Request, Response
> >          ^
> > SyntaxError: invalid syntax
> >>>>
> > -bash-3.2$
> >
> >
> > BR
> > 11/18/2010
> >
> >
> >
>