phauer / migrate-itunes-to-rhythmbox

Script to migrate iTunes playlists, play counts and ratings to Rhythmbox.
GNU General Public License v3.0
38 stars 10 forks source link

Installation issues on Ubuntu 20.04.3 LTS (with workaround) #24

Open exscape opened 2 years ago

exscape commented 2 years ago

The recommended installation gives a pip error:

$ pip3 install https://github.com/phauer/migrate-itunes-to-rhythmbox/releases/download/1.0.3/migrate-itunes-to-rhythmbox-1.0.3.tar.gz --process-dependency-links --user

Usage:   
...

no such option: --process-dependency-links

Removing the option instead yields an error about installing pyItunes:

ERROR: Could not find a version that satisfies the requirement pyItunes==1.4 (from migrate-itunes-to-rhythmbox==1.0.3) (from versions: 1.0.0, 1.0.1)
ERROR: No matching distribution found for pyItunes==1.4 (from migrate-itunes-to-rhythmbox==1.0.3)

I installed pyItunes manually:

$ git clone https://github.com/phauer/pyitunes
$ cd pyitunes
$ pip install .

After that, attempting to install migrate-itunes-to-rhythmbox fails with an error about xslt-config not found. As per the error text I installed libxml2 and libxslt:

$ sudo apt install libxml2-dev libxslt-dev

The pip3 install of the script still fails however, due to lxml not compiling properly. This seems to be because the very old lxml version (3.6.4 from 2016) doesn't support Python 3.8(.10).

I then downloaded the script .tar.gz, unpacked it, and edited setup.py to change the lxml requirement to lxml==4.7.1:

$ wget https://github.com/phauer/migrate-itunes-to-rhythmbox/releases/download/1.0.3/migrate-itunes-to-rhythmbox-1.0.3.tar.gz
$ tar xf migrate-itunes-to-rhythmbox-1.0.3.tar.gz
$ cd migrate-itunes-to-rhythmbox-1.0.3
$ nano setup.py

...and it finally installed fine with

$ pip3 install . --user
PHY1643 commented 2 years ago

Following the above instructions, I was able to successfully install both pyItunes and the migration script itself on PureOS 10. However, the developer's most current available version of pyItunes includes the call "plistlib.readPlist()", which is deprecated.

To address this issue, I edited the file "Library.py" within the pyItunes installation directory. (For me, this was installed within a subdirectory of ~/.local/lib/python3.9/ )

On line 26, replace this:

self.il = plistlib.readPlist(itunesxml) #Much better support of xml special characters

with this (2 lines):

with open(itunesxml, 'rb') as f:
    self.il = plistlib.load(f)

After that, the migration script was able to run and transfer my play counts, ratings, etc.

c0f commented 2 years ago

Thank you PHY1634, much appreciated.