librelist archives

« back to archive

Error: uWSGI Error, Python application not found

Error: uWSGI Error, Python application not found

From:
Kundan Singh
Date:
2013-05-25 @ 04:58
Hi... I am deploying a flask app using Nginx, uWSGI. I am getting error *uWSGI
Error Python application not found*


My app directory is:
**********************************************************************************
 */var/www/flasksite.com*
                     * runserver.py*  #my file having __name__ == __'main'__
                      */flask*  #virtualenv folder containing *pip install
Flask*
                     * /flasksite* # folder containing app files __init__,
models.py files.

***********************************************************************************


My uWSGI configuration file *flasksite.ini* is:

**********************************************************************************
*[uwsgi]*
*# Variables*
*base = /var/www/flasksite.com*
*module = runserver*
*callable = **flasksite*
*#virtualenv=%(base)/flask*
*# Generic Config*
*uid = www-data*
*gid = www-data*
*chmod-socket = 666*
*plugins = python*
*home = %(base)/flask*
*pythonpath = %(base)*
*socket = 127.0.0.1:3031*
*logto = /var/log/uwsgi/%n.log*
**********************************************************************************
And when i run it, i get error in log as:

*****
*compiled with version: 4.7.1 on 17 September 2012 17:20:40 **detected
number of CPU cores: 1 **current working directory: /etc/uwsgi/apps-enabled*
*detected binary path: /usr/bin/uwsgi-core **your memory page size is 4096
bytes*
*detected max file descriptor number: 1024 **lock engine: pthread robust
mutexes*
*
*
*uwsgi socket 0 bound to TCP address 127.0.0.1:3031 fd 3 **Python version:
2.7.3 (default, Sep 26 2012, 21:57:08)  [GCC 4.7.2] **Set PythonHome to
/var/www/flasksite.com/flask ***** Python threads support is disabled. You
can enable it with --enable-threads ***** **Python main interpreter
initialized at 0x93e1070*
*your server socket listen backlog is limited to 100 connections *****
Operational MODE: single process ***  **added /var/www/flasksite.com/ to
pythonpath.*
*Traceback (most recent call last):*
*  File "/var/www/flasksite.com/runserver.py", line 1, in <module>*
*  *
*  from flask import Flask*
*ImportError: No module named flask*
*unable to load app 0 (mountpoint='') (callable not found or import error)*
*
*
**** no app loaded. going in full dynamic mode ****
**** uWSGI is running in multiple interpreter mode ****
*spawned uWSGI master process (pid: 9052)*
*spawned uWSGI *
*worker 1 (pid: 9053, cores: 1)*
*[pid: 9053|app: -1|req: -1/1] 116.202.84.0 () {40 vars in 653 bytes} *
*[Sat May 25 04:44:17 2013] GET / => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)*
*announcing my loyalty to the Emperor...*
*[pid: 9053|app: -1|req: -1/2] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 04:44:17 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)*
*[pid: 9053|app: -1|req: -1/3] 116.202.84.0 () {40 vars in 653 bytes} [Sat
May 25 04:44:19 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500)
2 headers in 63 bytes (0 switches on core 0)*
*[pid: 9053|app: -1|req: -1/4] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 04:44:20 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)*
*[pid: 9053|app: -1|req: -1/5] 116.202.84.0 () {40 vars in 653 bytes} [Sat
May 25 04:44:21 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500)
2 headers in 63 bytes (0 switches on core 0)*
*[pid: 9053|app: -1|req: -1/6] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 04:44:21 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)*
*[pid: 9053|app: -1|req: -1/7] 116.202.84.0 () {40 vars in 653 bytes} [Sat
May 25 04:44:47 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500)
2 headers in 63 bytes (0 switches on core 0)*
*[pid: 9053|app: -1|req: -1/8] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 04:44:48 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)*


Being newbie to flask and uwsgi configurations i don't know how to resolve
this issue.

Please help

Thanks
Kundan Singh

Re: [flask] Error: uWSGI Error, Python application not found

From:
Roberto De Ioris
Date:
2013-05-25 @ 05:02
> Hi... I am deploying a flask app using Nginx, uWSGI. I am getting error
> *uWSGI
> Error Python application not found*
>
>
> My app directory is:
> 
**********************************************************************************
>  */var/www/flasksite.com*
>                      * runserver.py*  #my file having __name__ ==
> __'main'__
>                       */flask*  #virtualenv folder containing *pip install
> Flask*
>                      * /flasksite* # folder containing app files __init__,
> models.py files.
> 
***********************************************************************************
>
>
> My uWSGI configuration file *flasksite.ini* is:
>
> 
**********************************************************************************
> *[uwsgi]*
> *# Variables*
> *base = /var/www/flasksite.com*
> *module = runserver*
> *callable = **flasksite*
> *#virtualenv=%(base)/flask*


this is commented the virtualenv will not be set

--
Roberto De Ioris
http://unbit.it

Re: [flask] Error: uWSGI Error, Python application not found

From:
Kundan Singh
Date:
2013-05-25 @ 05:08
Hey, Roberto

If i uncomment and add *virtualenv = %(base)/flask *its still not working.
same error: python application not found.

Any suggestions?


On Sat, May 25, 2013 at 10:32 AM, Roberto De Ioris <roberto@unbit.it> wrote:

>
> > Hi... I am deploying a flask app using Nginx, uWSGI. I am getting error
> > *uWSGI
> > Error Python application not found*
> >
> >
> > My app directory is:
> >
> 
**********************************************************************************
> >  */var/www/flasksite.com*
> >                      * runserver.py*  #my file having __name__ ==
> > __'main'__
> >                       */flask*  #virtualenv folder containing *pip
> install
> > Flask*
> >                      * /flasksite* # folder containing app files
> __init__,
> > models.py files.
> >
> 
***********************************************************************************
> >
> >
> > My uWSGI configuration file *flasksite.ini* is:
> >
> >
> 
**********************************************************************************
> > *[uwsgi]*
> > *# Variables*
> > *base = /var/www/flasksite.com*
> > *module = runserver*
> > *callable = **flasksite*
> > *#virtualenv=%(base)/flask*
>
>
> this is commented the virtualenv will not be set
>
> --
> Roberto De Ioris
> http://unbit.it
>

Re: [flask] Error: uWSGI Error, Python application not found

From:
Alex Ogier
Date:
2013-05-25 @ 05:13
Is the traceback from the error log still the same?:

*Traceback (most recent call last):*
*  File "/var/www/flasksite.com/runserver.py", line 1, in <module>*
*  *
*  from flask import Flask*
*ImportError: No module named flask*
*unable to load app 0 (mountpoint='') (callable not found or import error)*


On Sat, May 25, 2013 at 1:08 AM, Kundan Singh <ksingh.pilani@gmail.com>wrote:

> Hey, Roberto
>
> If i uncomment and add *virtualenv = %(base)/flask *its still not
> working. same error: python application not found.
>
> Any suggestions?
>
>
> On Sat, May 25, 2013 at 10:32 AM, Roberto De Ioris <roberto@unbit.it>wrote:
>
>>
>> > Hi... I am deploying a flask app using Nginx, uWSGI. I am getting error
>> > *uWSGI
>> > Error Python application not found*
>> >
>> >
>> > My app directory is:
>> >
>> 
**********************************************************************************
>> >  */var/www/flasksite.com*
>> >                      * runserver.py*  #my file having __name__ ==
>> > __'main'__
>> >                       */flask*  #virtualenv folder containing *pip
>> install
>> > Flask*
>> >                      * /flasksite* # folder containing app files
>> __init__,
>> > models.py files.
>> >
>> 
***********************************************************************************
>> >
>> >
>> > My uWSGI configuration file *flasksite.ini* is:
>> >
>> >
>> 
**********************************************************************************
>> > *[uwsgi]*
>> > *# Variables*
>> > *base = /var/www/flasksite.com*
>> > *module = runserver*
>> > *callable = **flasksite*
>> > *#virtualenv=%(base)/flask*
>>
>>
>> this is commented the virtualenv will not be set
>>
>> --
>> Roberto De Ioris
>> http://unbit.it
>>
>
>

Re: [flask] Error: uWSGI Error, Python application not found

From:
Kundan Singh
Date:
2013-05-25 @ 05:31
yeah... its still same


On Sat, May 25, 2013 at 10:43 AM, Alex Ogier <alex.ogier@gmail.com> wrote:

> Is the traceback from the error log still the same?:
>
> *Traceback (most recent call last):*
> *  File "/var/www/flasksite.com/runserver.py", line 1, in <module>*
> *  *
> *  from flask import Flask*
> *ImportError: No module named flask*
> *unable to load app 0 (mountpoint='') (callable not found or import error)
> *
>
>
> On Sat, May 25, 2013 at 1:08 AM, Kundan Singh <ksingh.pilani@gmail.com>wrote:
>
>> Hey, Roberto
>>
>> If i uncomment and add *virtualenv = %(base)/flask *its still not
>> working. same error: python application not found.
>>
>> Any suggestions?
>>
>>
>> On Sat, May 25, 2013 at 10:32 AM, Roberto De Ioris <roberto@unbit.it>wrote:
>>
>>>
>>> > Hi... I am deploying a flask app using Nginx, uWSGI. I am getting error
>>> > *uWSGI
>>> > Error Python application not found*
>>> >
>>> >
>>> > My app directory is:
>>> >
>>> 
**********************************************************************************
>>> >  */var/www/flasksite.com*
>>> >                      * runserver.py*  #my file having __name__ ==
>>> > __'main'__
>>> >                       */flask*  #virtualenv folder containing *pip
>>> install
>>> > Flask*
>>> >                      * /flasksite* # folder containing app files
>>> __init__,
>>> > models.py files.
>>> >
>>> 
***********************************************************************************
>>> >
>>> >
>>> > My uWSGI configuration file *flasksite.ini* is:
>>> >
>>> >
>>> 
**********************************************************************************
>>> > *[uwsgi]*
>>> > *# Variables*
>>> > *base = /var/www/flasksite.com*
>>> > *module = runserver*
>>> > *callable = **flasksite*
>>> > *#virtualenv=%(base)/flask*
>>>
>>>
>>> this is commented the virtualenv will not be set
>>>
>>> --
>>> Roberto De Ioris
>>> http://unbit.it
>>>
>>
>>
>

Re: [flask] Error: uWSGI Error, Python application not found

From:
Roberto De Ioris
Date:
2013-05-25 @ 05:47
> yeah... its still same


Can you report it ? When you add a virtualenv the logs must be different
on startup

>
>
> On Sat, May 25, 2013 at 10:43 AM, Alex Ogier <alex.ogier@gmail.com> wrote:
>
>> Is the traceback from the error log still the same?:
>>
>> *Traceback (most recent call last):*
>> *  File "/var/www/flasksite.com/runserver.py", line 1, in <module>*
>> *  *
>> *  from flask import Flask*
>> *ImportError: No module named flask*
>> *unable to load app 0 (mountpoint='') (callable not found or import
>> error)
>> *
>>
>>
>> On Sat, May 25, 2013 at 1:08 AM, Kundan Singh
>> <ksingh.pilani@gmail.com>wrote:
>>
>>> Hey, Roberto
>>>
>>> If i uncomment and add *virtualenv = %(base)/flask *its still not
>>> working. same error: python application not found.
>>>
>>> Any suggestions?
>>>
>>>
>>> On Sat, May 25, 2013 at 10:32 AM, Roberto De Ioris
>>> <roberto@unbit.it>wrote:
>>>
>>>>
>>>> > Hi... I am deploying a flask app using Nginx, uWSGI. I am getting
>>>> error
>>>> > *uWSGI
>>>> > Error Python application not found*
>>>> >
>>>> >
>>>> > My app directory is:
>>>> >
>>>> 
**********************************************************************************
>>>> >  */var/www/flasksite.com*
>>>> >                      * runserver.py*  #my file having __name__ ==
>>>> > __'main'__
>>>> >                       */flask*  #virtualenv folder containing *pip
>>>> install
>>>> > Flask*
>>>> >                      * /flasksite* # folder containing app files
>>>> __init__,
>>>> > models.py files.
>>>> >
>>>> 
***********************************************************************************
>>>> >
>>>> >
>>>> > My uWSGI configuration file *flasksite.ini* is:
>>>> >
>>>> >
>>>> 
**********************************************************************************
>>>> > *[uwsgi]*
>>>> > *# Variables*
>>>> > *base = /var/www/flasksite.com*
>>>> > *module = runserver*
>>>> > *callable = **flasksite*
>>>> > *#virtualenv=%(base)/flask*
>>>>
>>>>
>>>> this is commented the virtualenv will not be set
>>>>
>>>> --
>>>> Roberto De Ioris
>>>> http://unbit.it
>>>>
>>>
>>>
>>
>


-- 
Roberto De Ioris
http://unbit.it

Re: [flask] Error: uWSGI Error, Python application not found

From:
Kundan Singh
Date:
2013-05-25 @ 07:11
Hey... The current error log says:

*** Starting uWSGI 1.2.3-debian (32bit) on [Sat May 25 07:00:31 2013]
***
compiled with version: 4.7.1 on 17 September 2012 17:20:40
detected number of CPU cores: 1
current working directory: /etc/uwsgi/apps-enabled

detected binary path: /usr/bin/uwsgi-core
your memory page size is 4096 bytes

detected max file descriptor number: 1024
lock engine: pthread robust mutexes
uwsgi socket 0 bound to TCP address 127.0.0.1:3031
 fd 3
Python version: 2.7.3 (default, Sep 26 2012, 21:57:08)  [GCC 4.7.2]

Set PythonHome to /var/www/backmunch.com/flask
*** Python threads support is disabled.
 You can enable it with --enable-threads ***
Python main interpreter initialized at 0x8f180d0

your server socket listen backlog is limited to 100 connections
***
 Operational MODE: single process ***
added /var/www/backmunch.com/ to pythonpath.

Traceback (most recent call last):
  File "/var/www/backmunch.com/runserver.py", line 1, in <module>

from flask import Flask
 ImportError: No module named flask

unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded.
 going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 9601)

spawned uWSGI worker 1 (pid: 9602, cores: 1)
[pid: 9602|app: -1|req: -1/1] 116.202.84.0 () {40 vars in 653 bytes} [Sat
May 25 07:00:34 2013]
 GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63
bytes (0 switches on core 0)
announcing my loyalty to the Emperor...
[pid: 9602|app: -1|req: -1/2] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 07:00:34 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
[pid: 9602|app: -1|req: -1/3] 116.202.84.0 () {38 vars in 622 bytes} [Sat
May 25 07:00:47 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500)
2 headers in 63 bytes (0 switches on core 0)
[pid: 9602|app: -1|req: -1/4] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 07:00:48 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
[pid: 9602|app: -1|req: -1/5] 116.202.84.0 () {40 vars in 653 bytes} [Sat
May 25 07:05:25 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500)
2 headers in 63 bytes (0 switches on core 0)
[pid: 9602|app: -1|req: -1/6] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 07:05:26 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
[pid: 9602|app: -1|req: -1/7] 116.202.84.0 () {40 vars in 653 bytes} [Sat
May 25 07:05:45 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500)
2 headers in 63 bytes (0 switches on core 0)
[pid: 9602|app: -1|req: -1/8] 116.202.84.0 () {38 vars in 584 bytes} [Sat
May 25 07:05:45 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
(HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)


So no change than previous log i think?

Any suggestions?


On Sat, May 25, 2013 at 11:17 AM, Roberto De Ioris <roberto@unbit.it> wrote:

>
> > yeah... its still same
>
>
> Can you report it ? When you add a virtualenv the logs must be different
> on startup
>
> >
> >
> > On Sat, May 25, 2013 at 10:43 AM, Alex Ogier <alex.ogier@gmail.com>
> wrote:
> >
> >> Is the traceback from the error log still the same?:
> >>
> >> *Traceback (most recent call last):*
> >> *  File "/var/www/flasksite.com/runserver.py", line 1, in <module>*
> >> *  *
> >> *  from flask import Flask*
> >> *ImportError: No module named flask*
> >> *unable to load app 0 (mountpoint='') (callable not found or import
> >> error)
> >> *
> >>
> >>
> >> On Sat, May 25, 2013 at 1:08 AM, Kundan Singh
> >> <ksingh.pilani@gmail.com>wrote:
> >>
> >>> Hey, Roberto
> >>>
> >>> If i uncomment and add *virtualenv = %(base)/flask *its still not
> >>> working. same error: python application not found.
> >>>
> >>> Any suggestions?
> >>>
> >>>
> >>> On Sat, May 25, 2013 at 10:32 AM, Roberto De Ioris
> >>> <roberto@unbit.it>wrote:
> >>>
> >>>>
> >>>> > Hi... I am deploying a flask app using Nginx, uWSGI. I am getting
> >>>> error
> >>>> > *uWSGI
> >>>> > Error Python application not found*
> >>>> >
> >>>> >
> >>>> > My app directory is:
> >>>> >
> >>>>
> 
**********************************************************************************
> >>>> >  */var/www/flasksite.com*
> >>>> >                      * runserver.py*  #my file having __name__ ==
> >>>> > __'main'__
> >>>> >                       */flask*  #virtualenv folder containing *pip
> >>>> install
> >>>> > Flask*
> >>>> >                      * /flasksite* # folder containing app files
> >>>> __init__,
> >>>> > models.py files.
> >>>> >
> >>>>
> 
***********************************************************************************
> >>>> >
> >>>> >
> >>>> > My uWSGI configuration file *flasksite.ini* is:
> >>>> >
> >>>> >
> >>>>
> 
**********************************************************************************
> >>>> > *[uwsgi]*
> >>>> > *# Variables*
> >>>> > *base = /var/www/flasksite.com*
> >>>> > *module = runserver*
> >>>> > *callable = **flasksite*
> >>>> > *#virtualenv=%(base)/flask*
> >>>>
> >>>>
> >>>> this is commented the virtualenv will not be set
> >>>>
> >>>> --
> >>>> Roberto De Ioris
> >>>> http://unbit.it
> >>>>
> >>>
> >>>
> >>
> >
>
>
> --
> Roberto De Ioris
> http://unbit.it
>

Re: [flask] Error: uWSGI Error, Python application not found

From:
Roberto De Ioris
Date:
2013-05-25 @ 07:56
> Hey... The current error log says:
>
> *** Starting uWSGI 1.2.3-debian (32bit) on [Sat May 25 07:00:31 2013]
> ***
> compiled with version: 4.7.1 on 17 September 2012 17:20:40
> detected number of CPU cores: 1
> current working directory: /etc/uwsgi/apps-enabled
>
> detected binary path: /usr/bin/uwsgi-core
> your memory page size is 4096 bytes
>
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> uwsgi socket 0 bound to TCP address 127.0.0.1:3031
>  fd 3
> Python version: 2.7.3 (default, Sep 26 2012, 21:57:08)  [GCC 4.7.2]
>
> Set PythonHome to /var/www/backmunch.com/flask
> *** Python threads support is disabled.
>  You can enable it with --enable-threads ***
> Python main interpreter initialized at 0x8f180d0
>
> your server socket listen backlog is limited to 100 connections
> ***
>  Operational MODE: single process ***
> added /var/www/backmunch.com/ to pythonpath.
>
> Traceback (most recent call last):
>   File "/var/www/backmunch.com/runserver.py", line 1, in <module>
>
> from flask import Flask
>  ImportError: No module named flask
>
> unable to load app 0 (mountpoint='') (callable not found or import error)
> *** no app loaded.
>  going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode ***
> spawned uWSGI master process (pid: 9601)
>
> spawned uWSGI worker 1 (pid: 9602, cores: 1)
> [pid: 9602|app: -1|req: -1/1] 116.202.84.0 () {40 vars in 653 bytes} [Sat
> May 25 07:00:34 2013]
>  GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63
> bytes (0 switches on core 0)
> announcing my loyalty to the Emperor...
> [pid: 9602|app: -1|req: -1/2] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> May 25 07:00:34 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> [pid: 9602|app: -1|req: -1/3] 116.202.84.0 () {38 vars in 622 bytes} [Sat
> May 25 07:00:47 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1
> 500)
> 2 headers in 63 bytes (0 switches on core 0)
> [pid: 9602|app: -1|req: -1/4] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> May 25 07:00:48 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> [pid: 9602|app: -1|req: -1/5] 116.202.84.0 () {40 vars in 653 bytes} [Sat
> May 25 07:05:25 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1
> 500)
> 2 headers in 63 bytes (0 switches on core 0)
> [pid: 9602|app: -1|req: -1/6] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> May 25 07:05:26 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> [pid: 9602|app: -1|req: -1/7] 116.202.84.0 () {40 vars in 653 bytes} [Sat
> May 25 07:05:45 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1
> 500)
> 2 headers in 63 bytes (0 switches on core 0)
> [pid: 9602|app: -1|req: -1/8] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> May 25 07:05:45 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
>
>
> So no change than previous log i think?


No, there is

Set PythonHome to /var/www/backmunch.com/flask

that confirm the virtualenv has been set right.

check if the flask module is correctly installed in the venv, and please
(not related) use a stable uWSGI version, not one of 2 years ago :)


-- 
Roberto De Ioris
http://unbit.it

Re: [flask] Error: uWSGI Error, Python application not found

From:
Kundan Singh
Date:
2013-05-25 @ 08:02
Should i add a new line into flasksite.ini (uWSGI) as:
*PythonHome = /var/www/backmunch.com/flask*
*
*
Done but no change. :(


On Sat, May 25, 2013 at 1:26 PM, Roberto De Ioris <roberto@unbit.it> wrote:

>
> > Hey... The current error log says:
> >
> > *** Starting uWSGI 1.2.3-debian (32bit) on [Sat May 25 07:00:31 2013]
> > ***
> > compiled with version: 4.7.1 on 17 September 2012 17:20:40
> > detected number of CPU cores: 1
> > current working directory: /etc/uwsgi/apps-enabled
> >
> > detected binary path: /usr/bin/uwsgi-core
> > your memory page size is 4096 bytes
> >
> > detected max file descriptor number: 1024
> > lock engine: pthread robust mutexes
> > uwsgi socket 0 bound to TCP address 127.0.0.1:3031
> >  fd 3
> > Python version: 2.7.3 (default, Sep 26 2012, 21:57:08)  [GCC 4.7.2]
> >
> > Set PythonHome to /var/www/backmunch.com/flask
> > *** Python threads support is disabled.
> >  You can enable it with --enable-threads ***
> > Python main interpreter initialized at 0x8f180d0
> >
> > your server socket listen backlog is limited to 100 connections
> > ***
> >  Operational MODE: single process ***
> > added /var/www/backmunch.com/ to pythonpath.
> >
> > Traceback (most recent call last):
> >   File "/var/www/backmunch.com/runserver.py", line 1, in <module>
> >
> > from flask import Flask
> >  ImportError: No module named flask
> >
> > unable to load app 0 (mountpoint='') (callable not found or import error)
> > *** no app loaded.
> >  going in full dynamic mode ***
> > *** uWSGI is running in multiple interpreter mode ***
> > spawned uWSGI master process (pid: 9601)
> >
> > spawned uWSGI worker 1 (pid: 9602, cores: 1)
> > [pid: 9602|app: -1|req: -1/1] 116.202.84.0 () {40 vars in 653 bytes} [Sat
> > May 25 07:00:34 2013]
> >  GET / => generated 48 bytes in 0 msecs (HTTP/1.1 500) 2 headers in 63
> > bytes (0 switches on core 0)
> > announcing my loyalty to the Emperor...
> > [pid: 9602|app: -1|req: -1/2] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> > May 25 07:00:34 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> > (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> > [pid: 9602|app: -1|req: -1/3] 116.202.84.0 () {38 vars in 622 bytes} [Sat
> > May 25 07:00:47 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1
> > 500)
> > 2 headers in 63 bytes (0 switches on core 0)
> > [pid: 9602|app: -1|req: -1/4] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> > May 25 07:00:48 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> > (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> > [pid: 9602|app: -1|req: -1/5] 116.202.84.0 () {40 vars in 653 bytes} [Sat
> > May 25 07:05:25 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1
> > 500)
> > 2 headers in 63 bytes (0 switches on core 0)
> > [pid: 9602|app: -1|req: -1/6] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> > May 25 07:05:26 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> > (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> > [pid: 9602|app: -1|req: -1/7] 116.202.84.0 () {40 vars in 653 bytes} [Sat
> > May 25 07:05:45 2013] GET / => generated 48 bytes in 0 msecs (HTTP/1.1
> > 500)
> > 2 headers in 63 bytes (0 switches on core 0)
> > [pid: 9602|app: -1|req: -1/8] 116.202.84.0 () {38 vars in 584 bytes} [Sat
> > May 25 07:05:45 2013] GET /favicon.ico => generated 48 bytes in 0 msecs
> > (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
> >
> >
> > So no change than previous log i think?
>
>
> No, there is
>
> Set PythonHome to /var/www/backmunch.com/flask
>
> that confirm the virtualenv has been set right.
>
> check if the flask module is correctly installed in the venv, and please
> (not related) use a stable uWSGI version, not one of 2 years ago :)
>
>
> --
> Roberto De Ioris
> http://unbit.it
>

Re: [flask] Error: uWSGI Error, Python application not found

From:
Roberto De Ioris
Date:
2013-05-25 @ 08:27
> Should i add a new line into flasksite.ini (uWSGI) as:
> *PythonHome = /var/www/backmunch.com/flask*
> *
> *
> Done but no change. :(


No, you need to check if flask is installed in your virtualenv, beause it
looks like it is not the case.

If you have difficult with venv, install flask system wide and retry to be
sure the problem is there


-- 
Roberto De Ioris
http://unbit.it

Re: [flask] Error: uWSGI Error, Python application not found

From:
Kundan Singh
Date:
2013-05-25 @ 08:36
I accidently deleted my *venv *folder  now re creating it using virtual
env. But when i run a *pip install Flask* in activated virtual env it says:

Requirement already satisfied (use --upgrade to upgrade): Flask in
/usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in
/usr/local/lib/python2.7/dist-packages (from Flask)
Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in
/usr/local/lib/python2.7/dist-packages (from Flask)
Cleaning up...

Why so?
How can i recreate my *venv*  and install Flask in it.


On Sat, May 25, 2013 at 1:57 PM, Roberto De Ioris <roberto@unbit.it> wrote:

>
> > Should i add a new line into flasksite.ini (uWSGI) as:
> > *PythonHome = /var/www/backmunch.com/flask*
> > *
> > *
> > Done but no change. :(
>
>
> No, you need to check if flask is installed in your virtualenv, beause it
> looks like it is not the case.
>
> If you have difficult with venv, install flask system wide and retry to be
> sure the problem is there
>
>
> --
> Roberto De Ioris
> http://unbit.it
>

Re: [flask] Error: uWSGI Error, Python application not found

From:
Roberto De Ioris
Date:
2013-05-25 @ 08:43
> I accidently deleted my *venv *folder  now re creating it using virtual
> env. But when i run a *pip install Flask* in activated virtual env it
> says:
>
> Requirement already satisfied (use --upgrade to upgrade): Flask in
> /usr/local/lib/python2.7/dist-packages
> Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7 in
> /usr/local/lib/python2.7/dist-packages (from Flask)
> Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in
> /usr/local/lib/python2.7/dist-packages (from Flask)
> Cleaning up...
>
> Why so?
> How can i recreate my *venv*  and install Flask in it.


you are not running in a venv environment.

The steps are simple:

virtualenv myflask
myflask/bin/pip install flask

(do not waste time making activation)


>
>
> On Sat, May 25, 2013 at 1:57 PM, Roberto De Ioris <roberto@unbit.it>
> wrote:
>
>>
>> > Should i add a new line into flasksite.ini (uWSGI) as:
>> > *PythonHome = /var/www/backmunch.com/flask*
>> > *
>> > *
>> > Done but no change. :(
>>
>>
>> No, you need to check if flask is installed in your virtualenv, beause
>> it
>> looks like it is not the case.
>>
>> If you have difficult with venv, install flask system wide and retry to
>> be
>> sure the problem is there
>>
>>
>> --
>> Roberto De Ioris
>> http://unbit.it
>>
>


-- 
Roberto De Ioris
http://unbit.it

Re: [flask] Error: uWSGI Error, Python application not found

From:
Yang Yang
Date:
2013-05-25 @ 08:53
2013/5/25 Roberto De Ioris <roberto@unbit.it>

>
> > I accidently deleted my *venv *folder  now re creating it using virtual
> > env. But when i run a *pip install Flask* in activated virtual env it
> > says:
> >
> > Requirement already satisfied (use --upgrade to upgrade): Flask in
> > /usr/local/lib/python2.7/dist-packages
> > Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7
> in
> > /usr/local/lib/python2.7/dist-packages (from Flask)
> > Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in
> > /usr/local/lib/python2.7/dist-packages (from Flask)
> > Cleaning up...
> >
> > Why so?
> > How can i recreate my *venv*  and install Flask in it.
>
>
> you are not running in a venv environment.
>
> The steps are simple:
>
> virtualenv myflask
> myflask/bin/pip install flask
>
> (do not waste time making activation)
>
>
> >
> >
> > On Sat, May 25, 2013 at 1:57 PM, Roberto De Ioris <roberto@unbit.it>
> > wrote:
> >
> >>
> >> > Should i add a new line into flasksite.ini (uWSGI) as:
> >> > *PythonHome = /var/www/backmunch.com/flask*
> >> > *
> >> > *
> >> > Done but no change. :(
> >>
> >>
> >> No, you need to check if flask is installed in your virtualenv, beause
> >> it
> >> looks like it is not the case.
> >>
> >> If you have difficult with venv, install flask system wide and retry to
> >> be
> >> sure the problem is there
> >>
> >>
> >> --
> >> Roberto De Ioris
> >> http://unbit.it
> >>
> >
>
>
> --
> Roberto De Ioris
> http://unbit.it
>

@Kundan Singh

Virtualenvwrapper is easy to use.

http://virtualenvwrapper.readthedocs.org/en/latest/

Re: [flask] Error: uWSGI Error, Python application not found

From:
Kundan Singh
Date:
2013-05-25 @ 08:53
Wow... At last app running.

Oh Being a Windows to Linux switcher... I need to learn a lot of stuff.

Thanks!!!


On Sat, May 25, 2013 at 2:13 PM, Roberto De Ioris <roberto@unbit.it> wrote:

>
> > I accidently deleted my *venv *folder  now re creating it using virtual
> > env. But when i run a *pip install Flask* in activated virtual env it
> > says:
> >
> > Requirement already satisfied (use --upgrade to upgrade): Flask in
> > /usr/local/lib/python2.7/dist-packages
> > Requirement already satisfied (use --upgrade to upgrade): Werkzeug>=0.7
> in
> > /usr/local/lib/python2.7/dist-packages (from Flask)
> > Requirement already satisfied (use --upgrade to upgrade): Jinja2>=2.4 in
> > /usr/local/lib/python2.7/dist-packages (from Flask)
> > Cleaning up...
> >
> > Why so?
> > How can i recreate my *venv*  and install Flask in it.
>
>
> you are not running in a venv environment.
>
> The steps are simple:
>
> virtualenv myflask
> myflask/bin/pip install flask
>
> (do not waste time making activation)
>
>
> >
> >
> > On Sat, May 25, 2013 at 1:57 PM, Roberto De Ioris <roberto@unbit.it>
> > wrote:
> >
> >>
> >> > Should i add a new line into flasksite.ini (uWSGI) as:
> >> > *PythonHome = /var/www/backmunch.com/flask*
> >> > *
> >> > *
> >> > Done but no change. :(
> >>
> >>
> >> No, you need to check if flask is installed in your virtualenv, beause
> >> it
> >> looks like it is not the case.
> >>
> >> If you have difficult with venv, install flask system wide and retry to
> >> be
> >> sure the problem is there
> >>
> >>
> >> --
> >> Roberto De Ioris
> >> http://unbit.it
> >>
> >
>
>
> --
> Roberto De Ioris
> http://unbit.it
>