Anthias icon indicating copy to clipboard operation
Anthias copied to clipboard

Upgrade to Python 3

Open vpetersson opened this issue 5 years ago • 27 comments

When we created Screenly OSE, Python 3 was still in its early days. Things have changed, and Python 2.7 is reaching EOL next year. It's time to start upgrading our code base to Python 3.

vpetersson avatar Apr 27 '19 07:04 vpetersson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 26 '19 07:06 stale[bot]

Hello, I have ported a different project from 2 to 3 in the past and I had zero problems, though it was definitely much smaller. In #1045 you mention that it's partly due to dependencies. Have you already identified which dependencies are affected?

Liz4v avatar Jun 27 '19 15:06 Liz4v

@ekevoo We'd love help with the upgrade to Python 3. Things have likely changed sin the initial comment in 1045, so I don't know if it is still the case. My gut feeling tells me that by now everything will work, and we will just need to refactor the code.

vpetersson avatar Jun 28 '19 10:06 vpetersson

I might be able to help, but I just installed Screenly for the first time yesterday and haven't looked at the code yet. I guess the two big initial questions are

  1. What's the situation with unicode strings and byte strings? Are they marked (u"" and b"" or are there usually from __future__ import unicode_literals)?
  2. I notice the installer spends quite some time and effort clearing out any potential python3 and manually pulls pip, which is what made me come look for this issue; is there an easy way to disable that? I don't want to have to wrestle with it for days.

Liz4v avatar Jun 28 '19 13:06 Liz4v

What's the situation with unicode strings and byte strings? Are they marked (u"" and b"" or are there usually from future import unicode_literals)?

That's a good question - @rusko124?

I notice the installer spends quite some time and effort clearing out any potential python3 and manually pulls pip, which is what made me come look for this issue; is there an easy way to disable that? I don't want to have to wrestle with it for days.

Sure, that's done in here.

vpetersson avatar Jun 28 '19 13:06 vpetersson

So I'm working at this today and I'm kind of puzzled on amf.py. I'm not sure what this does but it's clearly heavily encoding-related. I saw very few references to py2's str which is equivalent to py3's bytes.

Liz4v avatar Jul 07 '19 18:07 Liz4v

@rusko124 could you chime in here?

vpetersson avatar Jul 08 '19 12:07 vpetersson

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 06 '19 13:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 05 '19 13:11 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 10 '20 12:01 stale[bot]

@vpetersson Hey are you still interested in my help? My previous pull request is super stale and no longer usable, but I would appreciate if we could have a 30~60min meeting just to help me set up a testing environment so I can start over and build the PR in a way that the CI tools will be appeased.

Liz4v avatar Apr 11 '22 03:04 Liz4v

@ekevoo as you might have seen, we've resurrected this project a bit lately. An engineer is about to start working on OSE and one of the first tasks will be to start working on the Python 3 migration. If you're still interested in helping out, please let us know.

vpetersson avatar Sep 23 '22 11:09 vpetersson

Sure, no problem. Can I send you a calendar link privately? My Gmail username is the same as here.

Liz4v avatar Sep 27 '22 04:09 Liz4v

@ekevoo I've invited you to our Slack channel for Screenly OSE.

vpetersson avatar Sep 27 '22 09:09 vpetersson

Hello guys im trying to upgradeto python 3.9 on raspberry legacy 32 bit on pi 8gb but unfortunately i cant the reason its when i attempt to install screenly i receive this "could not find a version that satisfies the requirement ansible-core==2.12 " i read about it and in my understanding i must run python 3.9 , does any one faced that issue. Again its a Raspberian Legacy 32 bit /not lite version/

PaoloSymple avatar Oct 14 '22 16:10 PaoloSymple

First, never use the Desktop version of Raspbian/Raspberry Pi OS with Screenly. It will not work.

Second, the error your facing sounds like you're still on the production branch. Switch over to master and this should be solved.

vpetersson avatar Oct 14 '22 16:10 vpetersson

ok so somehow i was able to start the process under raspberian legacy but therefore i facing an error for could not find a version that satisfies the requirement ansible-core==2.12 and im looking in the link u send me there is nothing for that , when i tried to run it in lite version i cant get nowhere

On Fri, Oct 14, 2022 at 9:49 AM Viktor Petersson @.***> wrote:

First, never use the Desktop version of Raspbian/Raspberry Pi OS with Screenly. It will not work.

Second, the error your facing sounds like you're still on the production branch. Switch over to master and this should be solved.

— Reply to this email directly, view it on GitHub https://github.com/Screenly/screenly-ose/issues/1091#issuecomment-1279242044, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3TTAYM7POA7AUIF6YTK6DLWDGFKHANCNFSM4HI3UNTQ . You are receiving this because you commented.Message ID: @.***>

PaoloSymple avatar Oct 14 '22 16:10 PaoloSymple

Start over afresh and follow these instructions.

vpetersson avatar Oct 14 '22 16:10 vpetersson

ok ill give it a shot just to confirm u want me to install the raspberry pi os legacy lite ?

PaoloSymple avatar Oct 14 '22 16:10 PaoloSymple

No need for the legacy version. The latest (Bullseye Lite) should work just fine.

vpetersson avatar Oct 14 '22 17:10 vpetersson

ill give it a try now , but i did yesterday and it did give me some error but ill try does steps that u send me Victor thx !

PaoloSymple avatar Oct 14 '22 17:10 PaoloSymple

bash :/dev/fd/631: No such file or directory its the issue when i run it the way you said

PaoloSymple avatar Oct 14 '22 17:10 PaoloSymple

Start with a new SD card and re-flash it from the start. Your installation or SD card is likely broken.

vpetersson avatar Oct 14 '22 17:10 vpetersson

the SD card that i have its brand new actually from yesterday old

PaoloSymple avatar Oct 14 '22 17:10 PaoloSymple

now im getting Sceenly OSE must be installed as the user pi with sudo premission when i type sudo i get the exat same error i gave it to ya ..

PaoloSymple avatar Oct 14 '22 17:10 PaoloSymple

IMG_5736 this is what it comes when I run the script

PaoloSymple avatar Oct 14 '22 17:10 PaoloSymple

Based on the information, you're running Raspbian/Raspberry Pi OS Buster, not Bullseye. We haven't tested this on Buster.

vpetersson avatar Oct 17 '22 07:10 vpetersson

#1743 was already merged. Closing this ticket now... Thanks, @vpetersson and @EliseAv for your help, especially for the references.

nicomiguelino avatar Mar 03 '23 19:03 nicomiguelino