librelist archives

« back to archive

flaskext.script within Archlinux

flaskext.script within Archlinux

From:
Alex
Date:
2011-06-01 @ 05:56
Hi everyone,
flaskext.script seems to use 'python' to execute commands while Archlinux
refers 'python' to 'python3', and 'python2' to 'python 2.*'.
So flaskext.script can't works normally on my system.
Where to change the command so it can work for the specific system.
thanks.

Re: [flask] flaskext.script within Archlinux

From:
Peter Ward
Date:
2011-06-01 @ 09:35
Hi,

This would only make a difference if Flask-Script invoked python in a
subprocess, but my cursory glance over the source code didn’t show this to
be happening.
And even then, I’d imagine the only sane way to invoke python would be to
use sys.executable.

So, it should work fine—if it doesn’t, what is the specific error you’re
getting?
If you’re confused about the documentation always referring to "python
manage.py ...", don’t be, just mentally replace "python" with "python2".

(yes, you should be using virtualenv, but I don't think that's the problem
here)

Peter

On 1 June 2011 15:56, Alex <gfreezy@gmail.com> wrote:

> Hi everyone,
> flaskext.script seems to use 'python' to execute commands while Archlinux
> refers 'python' to 'python3', and 'python2' to 'python 2.*'.
> So flaskext.script can't works normally on my system.
> Where to change the command so it can work for the specific system.
> thanks.
>



-- 
Peter Ward
http://flowblok.id.au/
BIT III, Sydney University

Re: [flask] flaskext.script within Archlinux

From:
Jérôme Pigeot
Date:
2011-06-01 @ 11:45
Archlinux made python3 the default python interpreter, that's why it doesn't
work correctly.
I'm using it and what i did is just changing the python symbolic link

rm /usr/bin/python
ln -s /usr/bin/python2 /usr/bin/python

regards,
Jérôme.

Re: [flask] flaskext.script within Archlinux

From:
Alex
Date:
2011-06-01 @ 12:06
Thanks jerome. I just want to find a solution that doesn't need to change
the link.

2011/6/1 Jérôme Pigeot <j.pigeot@gmail.com>

> Archlinux made python3 the default python interpreter, that's why it
> doesn't work correctly.
> I'm using it and what i did is just changing the python symbolic link
>
> rm /usr/bin/python
> ln -s /usr/bin/python2 /usr/bin/python
>
> regards,
> Jérôme.
>
>

Re: [flask] flaskext.script within Archlinux

From:
Alex
Date:
2011-06-01 @ 11:30
Hi Peter,

First, thanks for replying.

The problem occurs when i run flask-celery's example.
The  manage.py is listed below:

*from __future__ import absolute_import*
*from flaskext.script import Manager*
*from flaskext.celery import install_commands as install_celery_commands*
*
*
*from myapp import create_app*
*
*
*app = create_app()*
*manager = Manager(app)*
*install_celery_commands(manager)*
*
*
*if __name__ == "__main__":*
*    manager.run()*
*
*
When i execute ./manage.py runserver, no error displays.However, when i
refer to 'localhost:5000',
the browser says 404. When just running 'python2 app.py', it works well.

app.py is just as simple as a index page. And i am definitely sure than it
has no mistakes.



2011/6/1 Peter Ward <peteraward@gmail.com>

> Hi,
>
> This would only make a difference if Flask-Script invoked python in a
> subprocess, but my cursory glance over the source code didn’t show this to
> be happening.
> And even then, I’d imagine the only sane way to invoke python would be to
> use sys.executable.
>
> So, it should work fine—if it doesn’t, what is the specific error you’re
> getting?
> If you’re confused about the documentation always referring to "python
> manage.py ...", don’t be, just mentally replace "python" with "python2".
>
> (yes, you should be using virtualenv, but I don't think that's the problem
> here)
>
> Peter
>
> On 1 June 2011 15:56, Alex <gfreezy@gmail.com> wrote:
>
>> Hi everyone,
>> flaskext.script seems to use 'python' to execute commands while Archlinux
>> refers 'python' to 'python3', and 'python2' to 'python 2.*'.
>> So flaskext.script can't works normally on my system.
>> Where to change the command so it can work for the specific system.
>> thanks.
>>
>
>
>
> --
> Peter Ward
> http://flowblok.id.au/
> BIT III, Sydney University
>

Re: [flask] flaskext.script within Archlinux

From:
Peter Ward
Date:
2011-06-01 @ 12:14
Surely you wouldn’t be able to use ./manage.py without a hashbang line?
Does it work if you add "#!/usr/bin/env python2" as the first line of
manage.py?

On 1 June 2011 21:30, Alex <gfreezy@gmail.com> wrote:

> Hi Peter,
>
> First, thanks for replying.
>
> The problem occurs when i run flask-celery's example.
> The  manage.py is listed below:
>
> *from __future__ import absolute_import*
> *from flaskext.script import Manager*
> *from flaskext.celery import install_commands as install_celery_commands*
> *
> *
> *from myapp import create_app*
> *
> *
> *app = create_app()*
> *manager = Manager(app)*
> *install_celery_commands(manager)*
> *
> *
> *if __name__ == "__main__":*
> *    manager.run()*
> *
> *
> When i execute ./manage.py runserver, no error displays.However, when i
> refer to 'localhost:5000',
> the browser says 404. When just running 'python2 app.py', it works well.
>
> app.py is just as simple as a index page. And i am definitely sure than it
> has no mistakes.
>
>
>
> 2011/6/1 Peter Ward <peteraward@gmail.com>
>
>> Hi,
>>
>> This would only make a difference if Flask-Script invoked python in a
>> subprocess, but my cursory glance over the source code didn’t show this to
>> be happening.
>> And even then, I’d imagine the only sane way to invoke python would be to
>> use sys.executable.
>>
>> So, it should work fine—if it doesn’t, what is the specific error you’re
>> getting?
>> If you’re confused about the documentation always referring to "python
>> manage.py ...", don’t be, just mentally replace "python" with "python2".
>>
>> (yes, you should be using virtualenv, but I don't think that's the problem
>> here)
>>
>> Peter
>>
>> On 1 June 2011 15:56, Alex <gfreezy@gmail.com> wrote:
>>
>>> Hi everyone,
>>> flaskext.script seems to use 'python' to execute commands while Archlinux
>>> refers 'python' to 'python3', and 'python2' to 'python 2.*'.
>>> So flaskext.script can't works normally on my system.
>>> Where to change the command so it can work for the specific system.
>>> thanks.
>>>
>>
>>
>>
>> --
>> Peter Ward
>> http://flowblok.id.au/
>> BIT III, Sydney University
>>
>
>


-- 
Peter Ward
http://flowblok.id.au/
BIT III, Sydney University

Re: [flask] flaskext.script within Archlinux

From:
Alex
Date:
2011-06-01 @ 12:20
I have changed  it. The manage.py runs ok.
I mean './manage.py runserver'  doesn't work correctly.

2011/6/1 Peter Ward <peteraward@gmail.com>

> Surely you wouldn’t be able to use ./manage.py without a hashbang line?
> Does it work if you add "#!/usr/bin/env python2" as the first line of
> manage.py?
>
>
> On 1 June 2011 21:30, Alex <gfreezy@gmail.com> wrote:
>
>> Hi Peter,
>>
>> First, thanks for replying.
>>
>>  The problem occurs when i run flask-celery's example.
>> The  manage.py is listed below:
>>
>> *from __future__ import absolute_import*
>> *from flaskext.script import Manager*
>> *from flaskext.celery import install_commands as install_celery_commands*
>> *
>> *
>> *from myapp import create_app*
>> *
>> *
>> *app = create_app()*
>>  *manager = Manager(app)*
>> *install_celery_commands(manager)*
>> *
>> *
>> *if __name__ == "__main__":*
>> *    manager.run()*
>> *
>> *
>> When i execute ./manage.py runserver, no error displays.However, when i
>> refer to 'localhost:5000',
>> the browser says 404. When just running 'python2 app.py', it works well.
>>
>> app.py is just as simple as a index page. And i am definitely sure than it
>> has no mistakes.
>>
>>
>>
>> 2011/6/1 Peter Ward <peteraward@gmail.com>
>>
>>> Hi,
>>>
>>> This would only make a difference if Flask-Script invoked python in a
>>> subprocess, but my cursory glance over the source code didn’t show this to
>>> be happening.
>>> And even then, I’d imagine the only sane way to invoke python would be to
>>> use sys.executable.
>>>
>>> So, it should work fine—if it doesn’t, what is the specific error you’re
>>> getting?
>>> If you’re confused about the documentation always referring to "python
>>> manage.py ...", don’t be, just mentally replace "python" with "python2".
>>>
>>> (yes, you should be using virtualenv, but I don't think that's the
>>> problem here)
>>>
>>> Peter
>>>
>>> On 1 June 2011 15:56, Alex <gfreezy@gmail.com> wrote:
>>>
>>>> Hi everyone,
>>>> flaskext.script seems to use 'python' to execute commands while
>>>> Archlinux refers 'python' to 'python3', and 'python2' to 'python 2.*'.
>>>> So flaskext.script can't works normally on my system.
>>>> Where to change the command so it can work for the specific system.
>>>> thanks.
>>>>
>>>
>>>
>>>
>>> --
>>> Peter Ward
>>> http://flowblok.id.au/
>>> BIT III, Sydney University
>>>
>>
>>
>
>
> --
> Peter Ward
> http://flowblok.id.au/
> BIT III, Sydney University
>

Re: [flask] flaskext.script within Archlinux

From:
Daniel , Dao Quang Minh
Date:
2011-06-01 @ 09:08
You should use virtualenv (+ virtualenvwrapper) to manage your python
environment. When inside virtualenv, python will refers to the python
version you chose

http://www.doughellmann.com/docs/virtualenvwrapper/

On Wed, Jun 1, 2011 at 1:56 PM, Alex <gfreezy@gmail.com> wrote:

> Hi everyone,
> flaskext.script seems to use 'python' to execute commands while Archlinux
> refers 'python' to 'python3', and 'python2' to 'python 2.*'.
> So flaskext.script can't works normally on my system.
> Where to change the command so it can work for the specific system.
> thanks.
>