EuroPython 2021: Opening our Merchandise Shop

2021-07-08 Thread Marc-Andre Lemburg
We’re very happy to announce our merchandise shop for EuroPython 2021,
with a fabulous new design for the attendee t-shirts:


   * EuroPython 2021 Merch Shop *

   https://ep2021.europython.eu/europython/europython-merchandise-shop/


You can find the shop under the "EuroPython" menu entry on the
conference website. It is run on the Spreadshirt platform and so
Spreadshirt will handle all payments, invoicing and shipping.

We have preconfigured a large number of items in the shop based on the
designs for EuroPython 2021, but you can also customize the looks by
clicking on the editing pen on the product pages.

Any profit this creates will go towards the EuroPython financial aid
budget, so will be put to good use.


Discounts
-

To make things a little easier for you, we have configured the following
discounts Spreadshirt offers:

- 20% off from July 8 - 11
- 15% off from July 12 - 15
- free shipping from July 16 - 19


Shipping worldwide
--

Spreadshirt is shipping to a lot of destinations worldwide.

Unfortunately, they don’t support shipping to the US, Australia, Brasil
and a few other countries on their European shop system for tax reasons.
If you'd like to order from one of those countries, perhaps you can find
a friendly Pythonista who would be willing to forward you the merch from
Europe.


Quick Summary
-
EuroPython 2021 will be run online from July 26 - August 1:

- Two workshop/training days (July 26 - 27)
- Three conference days (July 28 - 30)
- Two sprint days (July 31 - August 1)

The sessions will be scheduled to ensure they are also accessible for
those in the Asian and Americas time zones.

More infos are available on our website at https://ep2021.europython.eu/


Help spread the word


Please help us spread this message by sharing it on your social
networks as widely as possible. Thank you !

Link to the blog post:

https://blog.europython.eu/europython-2021-opening-our-merchandise-shop/

Tweet:

https://twitter.com/europython/status/1413062098331054083

Enjoy,
--
EuroPython 2021 Team
https://ep2021.europython.eu/
https://www.europython-society.org/

-- 
https://mail.python.org/mailman/listinfo/python-list


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 err

2021-07-08 Thread vergos....@gmail.com
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@superhost wsgi]$ export FLASK_APP=www.py
[nikos@superhost wsgi]$ export FLASK_ENV=development
[nikos@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 
import counters
  File "/home/nikos/wsgi/counters.py", line 6, in 
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 

[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 

[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 
13975291008] [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 
13975291008] [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 
13975291008] [remote 89.210.199.119:13389] Traceback (most recent call 
last):

[Thu Jul 08 15:08:40.075802 2021] [wsgi:error] [pid 575443:tid 
13975291008] [remote 89.210.199.119:13389] File "/home/nikos/wsgi/www.py", 
line 4, in 

[Thu Jul 08 15:08:40.075805 2021] [wsgi:error] [pid 575443:tid 
13975291008] [remote 89.210.199.119:13389] import counters

[Thu Jul 08 15:08:40.075810 2021] [wsgi:error] [pid 575443:tid 
13975291008] [remote 89.210.199.119:13389] File 
"/home/nikos/wsgi/counters.py", line 6, in 

[Thu Jul 08 15:08:40.075813 2021] [wsgi:error] [pid 575443:tid 
13975291008] [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 
13975291008] [remote 89.210.199.119:13389] ImportError: cannot import name 
'run'
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 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

2021-07-08 Thread Νίκος Βέργος
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@superhost ~]# whereis flask
flask: /usr/local/bin/flask

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

> 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@gmail.com <
> vergos.niko...@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@superhost wsgi]$ export FLASK_APP=www.py
>> [nikos@superhost wsgi]$ export FLASK_ENV=development
>> [nikos@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 
>> import counters
>>   File "/home/nikos/wsgi/counters.py", line 6, in 
>> 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 
>>
>> [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 
>>
>> [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
>> 13975291008] [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
>> 13975291008] [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
>> 13975291008] [remote 89.210.199.119:13389] Traceback (most recent
>> call last):
>>
>> [Thu Jul 08 15:08:40.075802 2021] [wsgi:error] [pid 575443:tid
>> 13975291008] [remote 89.210.199.119:13389] File
>> "/home/nikos/wsgi/www.py", line 4, in 
>>
>> [Thu Jul 08 15:08:40.075805 2021] [wsgi:error] [pid 575443:tid
>> 13975291008] [remote 89.210.199.119:13389] import counters
>>
>> [Thu Jul 08 15:08:40.075810 2021] [wsgi:error] [pid 575443:tid
>> 13975291008] [remote 89.210.199.119:13389] File
>> "/home/nikos/wsgi/counters.py", line 6, in 
>>
>> [Thu Jul 08 15:08:40.075813 2021] [wsgi:error] [pid 575443:tid
>> 13975291008] [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
>> 13975291008] [remote 89.210.199.119:13389] ImportError: cannot
>> import name 'run'
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 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

2021-07-08 Thread Stestagg
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@gmail.com <
vergos.niko...@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@superhost wsgi]$ export FLASK_APP=www.py
> [nikos@superhost wsgi]$ export FLASK_ENV=development
> [nikos@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 
> import counters
>   File "/home/nikos/wsgi/counters.py", line 6, in 
> 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 
>
> [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 
>
> [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
> 13975291008] [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
> 13975291008] [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
> 13975291008] [remote 89.210.199.119:13389] Traceback (most recent
> call last):
>
> [Thu Jul 08 15:08:40.075802 2021] [wsgi:error] [pid 575443:tid
> 13975291008] [remote 89.210.199.119:13389] File
> "/home/nikos/wsgi/www.py", line 4, in 
>
> [Thu Jul 08 15:08:40.075805 2021] [wsgi:error] [pid 575443:tid
> 13975291008] [remote 89.210.199.119:13389] import counters
>
> [Thu Jul 08 15:08:40.075810 2021] [wsgi:error] [pid 575443:tid
> 13975291008] [remote 89.210.199.119:13389] File
> "/home/nikos/wsgi/counters.py", line 6, in 
>
> [Thu Jul 08 15:08:40.075813 2021] [wsgi:error] [pid 575443:tid
> 13975291008] [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
> 13975291008] [remote 89.210.199.119:13389] ImportError: cannot import
> name 'run'
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 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

2021-07-08 Thread Stestagg
[my reply on the list this time :)]

That's fine.  Sorry, I should have provided more information.

This type of error that you're gettting /can/ happen if you have the
library correctly installed, but within your project, you have a different
file of the same name as the library.
Then when python tries to import 'flask', it actually imports your local
file, NOT the installed flask.

You see the error message is *not* saying that python can't find flask, but
that it can't find a name `run` within the flask module:

  from flask import run, route, request, redirect
ImportError: cannot import name 'run'

Therefore python has successfully found a module named flask somewhere,
just that it's probably not the module you were expecting it to find.

This is almost always because of the file name issue I mentioned above, OR
because the wrong version of flask has been installed, or something similar.

One thing to try would be at the *very* top of counters.py, add the
following lines:
import flask
print(flask)

then run your command again, and see what the stdout output is. You should
see something like:



Does XX look like the right place for the flask installation? if not,
then that's the problem.

Steve

On Thu, Jul 8, 2021 at 5:08 PM Νίκος Βέργος 
wrote:

> 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@superhost ~]# whereis flask
> flask: /usr/local/bin/flask
>
> Στις Πέμ, 8 Ιουλ 2021 στις 7:02 μ.μ., ο/η Stestagg 
> έγραψε:
>
>> 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@gmail.com <
>> vergos.niko...@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@superhost wsgi]$ export FLASK_APP=www.py
>>> [nikos@superhost wsgi]$ export FLASK_ENV=development
>>> [nikos@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 
>>> import counters
>>>   File "/home/nikos/wsgi/counters.py", line 6, in 
>>> 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 
>>>
>>> [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 
>>>
>>> [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
>>> 13975291008] [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
>>> 13975291008] [remote 89.210.199.119:13389] mod_wsgi (pid=575443):
>>> Exception occurred processing WSGI script '/home/nikos/w

Re: 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

2021-07-08 Thread vergos....@gmail.com
Στις Πέμπτη, 8 Ιουλίου 2021 στις 7:16:27 μ.μ. UTC+3, ο χρήστης Stestagg έγραψε:
> [my reply on the list this time :)] 
> 
> That's fine. Sorry, I should have provided more information. 
> 
> This type of error that you're gettting /can/ happen if you have the 
> library correctly installed, but within your project, you have a different 
> file of the same name as the library. 
> Then when python tries to import 'flask', it actually imports your local 
> file, NOT the installed flask. 
> 
> You see the error message is *not* saying that python can't find flask, but 
> that it can't find a name `run` within the flask module:
> from flask import run, route, request, redirect 
> ImportError: cannot import name 'run'
> Therefore python has successfully found a module named flask somewhere, 
> just that it's probably not the module you were expecting it to find. 
> 
> This is almost always because of the file name issue I mentioned above, OR 
> because the wrong version of flask has been installed, or something similar. 
> 
> One thing to try would be at the *very* top of counters.py, add the 
> following lines: 
> import flask 
> print(flask) 
> 
> then run your command again, and see what the stdout output is. You should 
> see something like: 
> 
>  
> 
> Does XX look like the right place for the flask installation? if not, 
> then that's the problem. 

After inserting the lines you told me i get the following when i try to run it 
via browser

[nikos@superhost wsgi]$ tail -f ../logs/error_log
[Thu Jul 08 19:22:31.042014 2021] [wsgi:error] [pid 575443:tid 13975291008] 
[remote 89.210.199.119:4206] ImportError: cannot import name 'run'
[Thu Jul 08 19:22:32.723900 2021] [wsgi:error] [pid 575443:tid 139757752112896] 

[Thu Jul 08 19:22:32.724068 2021] [wsgi:error] [pid 575443:tid 139757752112896] 
[remote 89.210.199.119:8556] mod_wsgi (pid=575443): Failed to exec Python 
script file '/home/nikos/wsgi/www.py'.

should i try always to run flask via browser or as "flask run" ? os is it the 
same?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 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

2021-07-08 Thread vergos....@gmail.com
Στις Πέμπτη, 8 Ιουλίου 2021 στις 7:09:49 μ.μ. UTC+3, ο χρήστης Stestagg έγραψε:
> Hi 
> 
> Do you have a file or folder named 'flask' in the same directory as www.py 
> by any chance? 

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@superhost ~]# whereis flask
flask: /usr/local/bin/flask
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: 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

2021-07-08 Thread vergos....@gmail.com
Στις Πέμπτη, 8 Ιουλίου 2021 στις 7:16:27 μ.μ. UTC+3, ο χρήστης Stestagg έγραψε:
> [my reply on the list this time :)] 
> 
> That's fine. Sorry, I should have provided more information. 
> 
> This type of error that you're gettting /can/ happen if you have the 
> library correctly installed, but within your project, you have a different 
> file of the same name as the library. 
> Then when python tries to import 'flask', it actually imports your local 
> file, NOT the installed flask. 
> 
> You see the error message is *not* saying that python can't find flask, but 
> that it can't find a name `run` within the flask module:
> from flask import run, route, request, redirect 
> ImportError: cannot import name 'run'
> Therefore python has successfully found a module named flask somewhere, 
> just that it's probably not the module you were expecting it to find. 
> 
> This is almost always because of the file name issue I mentioned above, OR 
> because the wrong version of flask has been installed, or something similar. 
> 
> One thing to try would be at the *very* top of counters.py, add the 
> following lines: 
> import flask 
> print(flask) 
> 
> then run your command again, and see what the stdout output is. You should 
> see something like: 
> 
>  
> 
> Does XX look like the right place for the flask installation? if not, 
> then that's the problem. 
> 
> Steve 
> 
> On Thu, Jul 8, 2021 at 5:08 PM Νίκος Βέργος  
> wrote:
> > 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@superhost ~]# whereis flask 
> > flask: /usr/local/bin/flask 
> >
> > Στις Πέμ, 8 Ιουλ 2021 στις 7:02 μ.μ., ο/η Stestagg 
> > έγραψε: 
> > 
> >> 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@gmail.com < 
> >> vergos@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@superhost wsgi]$ export FLASK_APP=www.py 
> >>> [nikos@superhost wsgi]$ export FLASK_ENV=development 
> >>> [nikos@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  
> >>> import counters 
> >>> File "/home/nikos/wsgi/counters.py", line 6, in  
> >>> 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  
> >>> 
> >>> [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  
> >>> 
> >>> [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 
> >>> 13975291008] [remote 89.210.199.119:13389] 

Re: 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

2021-07-08 Thread Menno Holscher

Op 08-07-2021 om 15:42 schreef vergos@gmail.com:

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"
This error is the error any web site shows when the code of your 
application has an error.

How can i find out what is the culprit here?

 [nikos@superhost wsgi]$ export FLASK_APP=www.py
 [nikos@superhost wsgi]$ export FLASK_ENV=development
 [nikos@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 
 import counters
   File "/home/nikos/wsgi/counters.py", line 6, in 
 from flask import run, route, request, redirect
 ImportError: cannot import name 'run'

When I import flask in the REPL (the Python command processor) and look 
at what it exports:


>>> import flask
>>> dir(flask)
['Blueprint', 'Config', 'Flask', 'Markup', 'Request', 'Response', 
'Session', '__builtins__', '__cached__', '__doc__', '__file__', 
'__loader__', '__name__', '__package__', '__path__', '__spec__', 
'__version__', '_app_ctx_stack', '_compat', '_request_ctx_stack', 
'abort', 'after_this_request', 'app', 'appcontext_popped', 
'appcontext_pushed', 'appcontext_tearing_down', 
'before_render_template', 'blueprints', 'cli', 'config', 
'copy_current_request_context', 'ctx', 'current_app', 'escape', 'flash', 
'g', 'get_flashed_messages', 'get_template_attribute', 'globals', 
'got_request_exception', 'has_app_context', 'has_request_context', 
'helpers', 'json', 'json_available', 'jsonify', 'make_response', 
'message_flashed', 'redirect', 'render_template', 
'render_template_string', 'request', 'request_finished', 
'request_started', 'request_tearing_down', 'safe_join', 'send_file', 
'send_from_directory', 'session', 'sessions', 'signals', 
'signals_available', 'stream_with_context', 'template_rendered', 
'templating', 'url_for', 'wrappers']

... there is no "run" there. What were you trying to achieve?

If you are thinking about the "flask run" mentioned in startup, that is 
a bash/cmd command, an easy way to start the server from the command line:


(venv):~/python/debtors> export FLASK_APP=debtors ; flask run
 * Serving Flask app "debtors"
 * Environment: production
   WARNING: This is a development server. Do not use it in a production 
deployment.

   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)


--
Met vriendelijke groet / Kind regards

Menno Hölscher


--
https://mail.python.org/mailman/listinfo/python-list


Re: 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

2021-07-08 Thread vergos....@gmail.com
Στις Παρασκευή, 9 Ιουλίου 2021 στις 12:03:00 π.μ. UTC+3, ο χρήστης Menno 
Holscher έγραψε:
> Op 08-07-2021 om 15:42 schreef vergos@gmail.com:
> > 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"
> This error is the error any web site shows when the code of your 
> application has an error.
> > How can i find out what is the culprit here? 
> > 
> > [nikos@superhost wsgi]$ export FLASK_APP=www.py 
> > [nikos@superhost wsgi]$ export FLASK_ENV=development 
> > [nikos@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  
> > import counters 
> > File "/home/nikos/wsgi/counters.py", line 6, in  
> > from flask import run, route, request, redirect 
> > ImportError: cannot import name 'run' 
> >
> When I import flask in the REPL (the Python command processor) and look 
> at what it exports: 
> 
> >>> import flask 
> >>> dir(flask) 
> ['Blueprint', 'Config', 'Flask', 'Markup', 'Request', 'Response', 
> 'Session', '__builtins__', '__cached__', '__doc__', '__file__', 
> '__loader__', '__name__', '__package__', '__path__', '__spec__', 
> '__version__', '_app_ctx_stack', '_compat', '_request_ctx_stack', 
> 'abort', 'after_this_request', 'app', 'appcontext_popped', 
> 'appcontext_pushed', 'appcontext_tearing_down', 
> 'before_render_template', 'blueprints', 'cli', 'config', 
> 'copy_current_request_context', 'ctx', 'current_app', 'escape', 'flash', 
> 'g', 'get_flashed_messages', 'get_template_attribute', 'globals', 
> 'got_request_exception', 'has_app_context', 'has_request_context', 
> 'helpers', 'json', 'json_available', 'jsonify', 'make_response', 
> 'message_flashed', 'redirect', 'render_template', 
> 'render_template_string', 'request', 'request_finished', 
> 'request_started', 'request_tearing_down', 'safe_join', 'send_file', 
> 'send_from_directory', 'session', 'sessions', 'signals', 
> 'signals_available', 'stream_with_context', 'template_rendered', 
> 'templating', 'url_for', 'wrappers'] 
> ... there is no "run" there. What were you trying to achieve? 
> 
> If you are thinking about the "flask run" mentioned in startup, that is 
> a bash/cmd command, an easy way to start the server from the command line: 
> 
> (venv):~/python/debtors> export FLASK_APP=debtors ; flask run 
> * Serving Flask app "debtors" 
> * Environment: production 
> WARNING: This is a development server. Do not use it in a production 
> deployment. 
> Use a production WSGI server instead. 
> * Debug mode: off 
> * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) 
> 
> 
> -- 
> Met vriendelijke groet / Kind regards 
> 
> Menno Hölscher

Now it complains it cannot find the module route.
How is that even possible?

Do i have  something wrong in the www.py?

from flask import Flask, route, request, redirect, render_template, url_for, 
send_from_directory, debug

app = Flask(__name__)
app.run(debug=True)

[nikos@superhost wsgi]$ flask run
 * Serving Flask app 'www.py' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production 
deployment.
   Use a production WSGI server instead.
 * Debug mode: off

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 
import counters
  File "/home/nikos/wsgi/counters.py", line 9, in 
from flask import route, request, redirect
ImportError: cannot import name 'route'

Also i use run for this

app.run( host='superhost.gr', port=5000, debug=True )
-- 
https://mail.python.org/mailman/listinfo/python-list