librelist archives

« back to archive

Report of a possible bug

Report of a possible bug

From:
Christophe Meessen
Date:
2013-01-07 @ 14:05
Hello,

I spent some time trying to understand why, after installing 
Flask_Babel, the instruction "from flask.ext.babel import Babel" would 
fail with an error.  My setup is Windows 7 64bit with C:\python27.

The error was removed by adding an empty __init__.py file in the 
c:\python27\lib\site-packages\flaskext directory, next to the babel.py 
file. After that "babel = Babel(app)" worked without error as well.

Maybe there is something to change somewhere so that people don't get 
stuck with the same problem I had.

It could be specific to windows. In my quest to solve the problem, I 
reinstalled everything, so this problem seam to appear with a standard 
install. I'm using SQLAlchemy and installed it prior to trying to 
install Flask_Babel. But I didn't installed and don't use 
Flask_SQLAlchemy. If this later package is installing the __init_.py 
file, it could explain why the problem I had has been unnoticed up to now.

-- 
Bien cordialement,

Ch. Meessen

Re: [flask] Report of a possible bug

From:
Markus Unterwaditzer
Date:
2013-01-07 @ 15:11
pip or setuptools should have created that file for you, if you haven't 
installed Flask-Babel by copying the files into that directory.

-- Markus

On 2013-01-07 15:05, Christophe Meessen wrote:
> Hello,
>
> I spent some time trying to understand why, after installing
> Flask_Babel, the instruction "from flask.ext.babel import Babel" 
> would
> fail with an error.  My setup is Windows 7 64bit with C:\python27.
>
> The error was removed by adding an empty __init__.py file in the
> c:\python27\lib\site-packages\flaskext directory, next to the 
> babel.py
> file. After that "babel = Babel(app)" worked without error as well.
>
> Maybe there is something to change somewhere so that people don't get
> stuck with the same problem I had.
>
> It could be specific to windows. In my quest to solve the problem, I
> reinstalled everything, so this problem seam to appear with a 
> standard
> install. I'm using SQLAlchemy and installed it prior to trying to
> install Flask_Babel. But I didn't installed and don't use
> Flask_SQLAlchemy. If this later package is installing the __init_.py
> file, it could explain why the problem I had has been unnoticed up to 
> now.

Re: [flask] Report of a possible bug

From:
Christophe Meessen
Date:
2013-01-07 @ 15:49
I used pip to install Flask and Flask_Babel but apparently it didn't 
create the __init__.py file.
When should it have created this file ? When Flask_Babel was installed 
or when Flask was installed ?

Le 07/01/2013 16:11, Markus Unterwaditzer a écrit :
> pip or setuptools should have created that file for you, if you haven't
> installed Flask-Babel by copying the files into that directory.
>
> -- Markus
>
> On 2013-01-07 15:05, Christophe Meessen wrote:
>> Hello,
>>
>> I spent some time trying to understand why, after installing
>> Flask_Babel, the instruction "from flask.ext.babel import Babel"
>> would
>> fail with an error.  My setup is Windows 7 64bit with C:\python27.
>>
>> The error was removed by adding an empty __init__.py file in the
>> c:\python27\lib\site-packages\flaskext directory, next to the
>> babel.py
>> file. After that "babel = Babel(app)" worked without error as well.
>>
>> Maybe there is something to change somewhere so that people don't get
>> stuck with the same problem I had.
>>
>> It could be specific to windows. In my quest to solve the problem, I
>> reinstalled everything, so this problem seam to appear with a
>> standard
>> install. I'm using SQLAlchemy and installed it prior to trying to
>> install Flask_Babel. But I didn't installed and don't use
>> Flask_SQLAlchemy. If this later package is installing the __init_.py
>> file, it could explain why the problem I had has been unnoticed up to
>> now.


-- 
Bien cordialement,

Ch. Meessen

Re: [flask] Report of a possible bug

From:
Markus Unterwaditzer
Date:
2013-01-07 @ 18:10
For me pip usually creates missing __init__.py files.

I *think* it should have done that to the flaskext folder when installing 
flask-babel.

Christophe Meessen <christophe@meessen.net> wrote:

>I used pip to install Flask and Flask_Babel but apparently it didn't 
>create the __init__.py file.
>When should it have created this file ? When Flask_Babel was installed 
>or when Flask was installed ?
>
>Le 07/01/2013 16:11, Markus Unterwaditzer a écrit :
>> pip or setuptools should have created that file for you, if you
>haven't
>> installed Flask-Babel by copying the files into that directory.
>>
>> -- Markus
>>
>> On 2013-01-07 15:05, Christophe Meessen wrote:
>>> Hello,
>>>
>>> I spent some time trying to understand why, after installing
>>> Flask_Babel, the instruction "from flask.ext.babel import Babel"
>>> would
>>> fail with an error.  My setup is Windows 7 64bit with C:\python27.
>>>
>>> The error was removed by adding an empty __init__.py file in the
>>> c:\python27\lib\site-packages\flaskext directory, next to the
>>> babel.py
>>> file. After that "babel = Babel(app)" worked without error as well.
>>>
>>> Maybe there is something to change somewhere so that people don't
>get
>>> stuck with the same problem I had.
>>>
>>> It could be specific to windows. In my quest to solve the problem, I
>>> reinstalled everything, so this problem seam to appear with a
>>> standard
>>> install. I'm using SQLAlchemy and installed it prior to trying to
>>> install Flask_Babel. But I didn't installed and don't use
>>> Flask_SQLAlchemy. If this later package is installing the __init_.py
>>> file, it could explain why the problem I had has been unnoticed up
>to
>>> now.
>
>
>-- 
>Bien cordialement,
>
>Ch. Meessen