For the record, apt installing uwsgi-plugin-python3 did not work for me. I 
considered compiling uwsgi manually with both plugins, and eventually 
migrated the whole server at once, since I have been using python3 without 
problems for some weeks. It was just a matter of pip uninstall uwsgi, pip3 
install uwsgi, restart the uwsgi unit and dealing a posteriori with the 
compiled pyc files, which would have been easier to do in advance :-[. 
Summary:

   1. backup all the error tickets, which you will lose because of the 
   pickle python2 and python3 incompatible formats (I guess you can carry them 
   to a separate offline python2 server, or maybe improve the admin app code 
   to try both pickle formats)
   2. remove all the complied apps
   3. update your /etc/uwsgi/sites/*.ini files and your crontab to run 
   python3 instead of python2
   4. pip uninstall uwsgi
   5. pip3 install uwsgi
   6. restart the uwsgi unit
   7. compile your app again

I think that's all, of course once you have tested-to-exhaustion your app 
with python3 locally.

Have a nice weekend
El jueves, 10 de septiembre de 2020 a las 4:40:16 UTC+2, 
[email protected] escribió:

> Thanks, Jim, though that link was not helpful. It is not clear to me that 
> installing uwsgi through pip3 will result in uwsgi using the python3 
> plugin, but anyway that is definitely not what I need right now, which is 
> to test a python3 app while I keep a python2 one.
>
> Anyway, I'm well served by tua...'s links, I'll just have to find some 
> high-attention-low-traffic timespan to attempt the solution ;-)
>
> El jueves, 10 de septiembre de 2020 a las 0:27:55 UTC+2, Jim S escribió:
>
>> We had a discussion about it earlier this year....
>>
>>
>> https://groups.google.com/forum/#!searchin/web2py/python3$20nginx%7Csort:date/web2py/BFvo2tn9IAI/nQMgO7HRBAAJ
>>
>> On Wednesday, September 9, 2020 at 9:57:50 AM UTC-5, tuan.ngo wrote:
>>
>>> I found some link concern with install py3 with Nginx & uwsgi.
>>>
>>>
>>> https://stackoverflow.com/questions/60115077/is-there-a-proper-way-to-make-web2py-use-python3-instead-of-python2
>>>
>>> https://gist.github.com/simoncoulton/2625954
>>>
>>> Anyway, I use Apache with libapache2-mod-wsgi-py3. It’s just work fine.
>>>
>>>  
>>>
>>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for 
>>> Windows 10
>>>
>>>  
>>>
>>> *From: *[email protected]
>>> *Sent: *Saturday, September 5, 2020 8:29 AM
>>> *To: *web2py-users
>>> *Subject: *[web2py] Re: is there a guide / discussion / hints for 
>>> migrating apps to python3?
>>>
>>>  
>>>
>>> If I got it right, it is just fine to run two web2py installs, one with 
>>> python2, the other with python3, it is only required to edit wsgihandler.py 
>>> and let it start with
>>>
>>>  
>>>
>>> #!/usr/bin/env python3
>>>
>>>  
>>>
>>> instead of
>>>
>>>  
>>>
>>> #!/usr/bin/env python
>>>
>>>  
>>>
>>> Regards
>>>
>>> El sábado, 5 de septiembre de 2020 a las 12:08:35 UTC+2, 
>>> [email protected] escribió:
>>>
>>>  
>>>
>>> Hello:
>>>
>>>  
>>>
>>> I know I'm late, but I'm migrating my app to python3. The 2to3 library 
>>> did most of the work. Most of the remaining errors were simple to solve, 
>>> having to do with string, bytes, encode and decode.
>>>
>>>  
>>>
>>> I found it odd that web2py returns str objects to the db queries, but 
>>> the xml() method returns a bytes object. This made a few replacements and 
>>> regex break, but it wasn't hard to fix. The translation object T() works 
>>> either way, which is great.
>>>
>>>  
>>>
>>> Two issues I would like to comment: 
>>>
>>>    - the gluon.contrib.json module breaks. It can be fixed by 2to3 and 
>>>    a bit of manual tinkering. I guess it is not necessary any more and the 
>>> job 
>>>    can be done with the standard library json, is it?
>>>    - Can you point me to documentation / google group thread / whatever 
>>>    concerning a standard as-in-the-book install with uwsgi, emperor, nginx, 
>>>    etc. I can't find the right place to tell uwsgi to use python3. I would 
>>>    actually like to switch from python2 to python3 first in a test site, 
>>> then 
>>>    in production, so for a time, there would be one web2py installation in 
>>>    python2 and other installation, with all its apps, in python3. Is this 
>>> even 
>>>    possible? I will be researching this guide in the meantime: 
>>>    
>>> https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html#bonus-multiple-python-versions-for-the-same-uwsgi-binary
>>>
>>> Regards
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>>
>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>>
>>
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/44c90a39-754a-4411-8954-0c5eb9a7e555n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/web2py/44c90a39-754a-4411-8954-0c5eb9a7e555n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2bb3b037-01bf-405a-8416-6a063f4bde20n%40googlegroups.com.

Reply via email to