How to use older version of Python?

I was using the “icloud photos downloader” python script from github to sync my photos on Fedora 34. After updating to Fedora 35 and Python 3.10, it’s broken. I searched on their issues page, and apparently it’s a known thing that it has problems after Python 3.8. Their advice is to use an older Python version. My understanding is I can’t or shouldn’t attempt to remove or downgrade Python system wide on Fedora, and dnf relies on it… so I don’t want to screw that up. I installed 3.8.11 successfully as an alternate version in addition to the default 3.10, but still having trouble making that icloudpd file run. I’m getting “/usr/local/bin/python3.8: can’t find ‘main’ module in ‘icloudpd’”

I think it’s not about Python version.

Did you try this?

pip install icloudpd

That error says that it can’t find this package inside Python 3.8’s library.
so may be try

python3.8 -m pip install icloudpd

So it install icloudpd for python3.8 and not 3.10

Thank you for your reply. I found as much while googling earlier, but I’m not very familiar with how to download and run the packages and then specifying which version of Python to use to run it. My understanding is your first one would install icloudpd to the default Python version’s folder, or wherever they go. And the second one installs to the specified version’s folder, and then you’d have to specify “python3.8 icloudpd” to run it instead of just “icloudpd.” I went out for a drive, came back, removed that extra python3.8 and just ran the old script like normal and it seems to work now. Just wish I understood why it works now. If I had already run “pip install icloudpd” previously (and then it tries to run using version 3.10 and fails), then I install python 3.8, and run your second command, how would it be smart enough to use the 3.8 when the command is simply “icloudpd” with no version specified? Shouldn’t it just try running on the default 3.10 and fail again? Thanks again for the help.

“/usr/local/bin/python3.8: can’t find ‘main’ module in ‘icloudpd”

It said it’s looking at python3.8’s libraries. So it’s running with Python 3.8. So I just assumed installing it where 3.8 looks for that library should fix it.

As for why it didn’t work before, I have no idea how the system manages different Pythons and picking one as default. But In my experience, 3.8 & 3.10 don’t have a significant difference to break anything. So they should work interchangably.

So my guess is first time didn’t install it right or needed a signout and login ( Random guess ).

To know which python you’re using as default.

I’ve always found tools such as pyenv useful for managing multiple versions of the runtime. Source: GitHub - pyenv/pyenv: Simple Python version management

2 Likes