i just moved from bottleframework to flask. I changes what needed to be altered to convert the code and when i run it i just get "Internal server error" Running tail -f ../logs/error_log i get no errors. How can i find out what is the culprit here?

Νίκος Βέργος vergos.nikolas at gmail.com
Thu Jul 8 12:08:21 EDT 2021


No, the way i have installed flask was under root account with the command
pip3 install flask.
But even if i installed flask  under my nikos user account its evene worse
as the file flask is not entered into PATH.

So i guess as root i have to install flask, but then why cant it import
'run" ?

[root at superhost ~]# whereis flask
flask: /usr/local/bin/flask

Στις Πέμ, 8 Ιουλ 2021 στις 7:02 μ.μ., ο/η Stestagg <stestagg at gmail.com>
έγραψε:

> Hi
>
> Do you have a file or folder named 'flask' in the same directory as www.py
> by any chance?
>
> Steve
>
> On Thu, Jul 8, 2021 at 4:50 PM vergos.... at gmail.com <
> vergos.nikolas at gmail.com> wrote:
>
>> i just moved from bottleframework to flask. I changes what needed to be
>> altered to convert the code and when i run it i just get "Internal server
>> error"
>>
>> Running tail -f ../logs/error_log i get no errors.
>>
>> How can i find out what is the culprit here?
>>
>>     [nikos at superhost wsgi]$ export FLASK_APP=www.py
>>     [nikos at superhost wsgi]$ export FLASK_ENV=development
>>     [nikos at superhost wsgi]$ flask run
>>      * Serving Flask app 'www.py' (lazy loading)
>>      * Environment: development
>>      * Debug mode: on
>>     Usage: flask run [OPTIONS]
>>     Try 'flask run --help' for help.
>>
>>     Error: While importing 'www', an ImportError was raised:
>>
>>     Traceback (most recent call last):
>>       File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line
>> 256, in locate_app
>>         __import__(module_name)
>>       File "/home/nikos/wsgi/www.py", line 4, in <module>
>>         import counters
>>       File "/home/nikos/wsgi/counters.py", line 6, in <module>
>>         from flask import run, route, request, redirect
>>     ImportError: cannot import name 'run'
>>
>> and this is the error_log when tries to be displayed via browser:
>>
>>     [Thu Jul 08 15:08:36.436195 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] mod_wsgi (pid=575443):
>> Failed to exec Python script file '/home/nikos/wsgi/www.py'.
>>
>>     [Thu Jul 08 15:08:36.436276 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] mod_wsgi (pid=575443):
>> Exception occurred processing WSGI script '/home/nikos/wsgi/www.py'.
>>
>>     [Thu Jul 08 15:08:36.436408 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] Traceback (most recent
>> call last):
>>
>>     [Thu Jul 08 15:08:36.436432 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] File
>> "/home/nikos/wsgi/www.py", line 4, in <module>
>>
>>     [Thu Jul 08 15:08:36.436436 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] import counters
>>
>>     [Thu Jul 08 15:08:36.436441 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] File
>> "/home/nikos/wsgi/counters.py", line 6, in <module>
>>
>>     [Thu Jul 08 15:08:36.436444 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] from flask import run,
>> route, request, redirect
>>
>>     [Thu Jul 08 15:08:36.436458 2021] [wsgi:error] [pid 575443:tid
>> 139757752112896] [remote 89.210.199.119:6718] ImportError: cannot import
>> name 'run'
>>
>>     [Thu Jul 08 15:08:40.075655 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] mod_wsgi (pid=575443):
>> Failed to exec Python script file '/home/nikos/wsgi/www.py'.
>>
>>     [Thu Jul 08 15:08:40.075703 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] mod_wsgi (pid=575443):
>> Exception occurred processing WSGI script '/home/nikos/wsgi/www.py'.
>>
>>     [Thu Jul 08 15:08:40.075785 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] Traceback (most recent
>> call last):
>>
>>     [Thu Jul 08 15:08:40.075802 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] File
>> "/home/nikos/wsgi/www.py", line 4, in <module>
>>
>>     [Thu Jul 08 15:08:40.075805 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] import counters
>>
>>     [Thu Jul 08 15:08:40.075810 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] File
>> "/home/nikos/wsgi/counters.py", line 6, in <module>
>>
>>     [Thu Jul 08 15:08:40.075813 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] from flask import run,
>> route, request, redirect
>>
>>     [Thu Jul 08 15:08:40.075825 2021] [wsgi:error] [pid 575443:tid
>> 139757777291008] [remote 89.210.199.119:13389] ImportError: cannot
>> import name 'run'
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>


More information about the Python-list mailing list