DarwinAwardWinner / rganalysis

A script for adding replaygain tags to music files
31 stars 4 forks source link

Run error #2

Closed alidaf closed 7 years ago

alidaf commented 7 years ago

This occurs when attempting to run on Linux Mint 17.3.

rganalysis File "/usr/local/bin/rganalysis", line 9 def plac_call_main() -> None: ^ SyntaxError: invalid syntax

DarwinAwardWinner commented 7 years ago

Are you using Python 2? The latest version is Python 3 only.

alidaf commented 7 years ago

Python3 is definitely installed but there may be others too.

alidaf commented 7 years ago

Running python directly gives me 2.7.9. I need to figure out how to force 3.

alidaf commented 7 years ago

I've managed to force the version using info here...https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux

but now I get ...

rganalysis Traceback (most recent call last): File "/usr/local/bin/rganalysis", line 3, in import plac ImportError: No module named 'plac'

DarwinAwardWinner commented 7 years ago

Did you follow the installation instructions using Python 3?

alidaf commented 7 years ago

Yes but it still doesn't work. These errors are all due to Python. Debian and Mint just don't like having multiple versions and there are many core dependencies on 2.7 so I can't remove it. Forcing 3 and installing python3-setuptools causes even more problems.

DarwinAwardWinner commented 7 years ago

In general, my recommendation for using Python is to install your own copy of Python in your home directory using pyenv and leave the system's copy of Python alone.

alidaf commented 7 years ago

I've tried everything now but I'm giving up. Even with python3 it's still moaning about dependencies for the backends, like lxml. I've tried running the script directly with python3 as a command but it won't work. I may as well just run foobar in wine or find an app for my Mac and try and mount the drives locally.

DarwinAwardWinner commented 7 years ago

It looks like I forgot to declare the backend dependency on lxml. I'll fix that shortly. Thanks for letting me know.

As for the rest: Like I said, I don't recommend using the system Python. If you still want to try to get it working, I'd install Python 3 using pyenv, then install rganalysis using pip. Also install lxml using pip (pip install lxml). Last, you'll need to install a backend. There's a bs1170gain package in Debian, so that's probably the easiest option.

alidaf commented 7 years ago

OK, I think I have it working. It's doing a dry run. This is what I had to do:

sudo apt-get install python3 python3-setuptools python3-pip python3-lxml bs1770gain sudo python3 -m pip install tqdm sudo python3 -m pip install https://github.com/DarwinAwardWinner/rganalysis/archive/master.zip

I think that's everything but I've had to backtrace through all of my commands to figure it all out.

The python3 -m just runs the python3 version of pip. lxml can be package installed rather than through pip.

I've downloaded python audio tools and compiled/installed it with

sudo apt-get install libmp3lame-dev download and unpack python audio tools from https://sourceforge.net/projects/audiotools/files/latest/download?source=files cd audio-tools- (mine was 3.1.1) sudo python3 setup.py build sudo python3 setup.py install

rganalysis is now running from the command line now with:

rganalysis -n -b bs1770gain

I've not tried python audio tools yet as my music library is huge and the dry run is still going.

Thanks for your patience and help. I hope this feedback helps.

Regards

alidaf commented 7 years ago

Using the python3 command also avoids having to run the update-alternatives command, forcing the default system-wide version of python, or pyenv.

DarwinAwardWinner commented 7 years ago

I don't think you need to install Python Audiotools manually. There's a package for that too. But you also only need one backend, unless you have files that the other backend doesn't support. If the bs1770gain backend is working for you, just use that and don't worry about audiotools.

alidaf commented 7 years ago

I was being thorough in case the bs1770gain didn't work! Thanks again.