Page 1 of 1

Python scripts not working

Posted: Tue Feb 05, 2019 5:55 pm
by funkmuscle
Michael (empowerg) wrote a few Py scripts for velocity and randomizing notes in the drum editor and piano roll(I think as I don't use).
They've stopped working. I've contacted Michael on FB and he said it could be a version thing of the Python.
This is the error I'm getting. I'm using Arch64.
PyQt fail.png
PyQt fail.png (33.05 KiB) Viewed 1115 times

Re: Python scripts not working

Posted: Tue Feb 05, 2019 8:17 pm
by Tim E. Real
Hi, I get this similar message but a slightly different missing module:

RandomizeVelocityRelative", line 31, in <module>
from PyQt4 import QtGui, QtCore
ImportError: cannot import name 'QtGui'

I am certain it is just a matter of installing the right modules.
I cannot check right now as I have over 3000 package updates but I'm
in the middle of something and it complains that dependencies are missing
so I need to wait until I'm finished my work to install everything at once...

Tim.

Re: Python scripts not working

Posted: Tue Feb 05, 2019 9:29 pm
by spamatica
Argh, PyQt4 is getting quite old, could be the packages are no longer complete.. The scripts should be ported to PyQt5, actually, didn't I do that already?! Hmm :S

I'm not that fluent in Arch packaging, as Tim says it could be a missing package, search for more pyqt packages?

It could be a python version issue too, as Michael suggests. If you have several python versions installed maybe not all of them have PyQt installed.

Re: Python scripts not working

Posted: Wed Feb 06, 2019 3:03 am
by funkmuscle
Michael tried a few things when I mentioned it to him on FB and he came to the conclusion it was PyQt4 thing.

Re: Python scripts not working

Posted: Wed Feb 06, 2019 1:03 pm
by artofmusic
Hopefully, They get ported to qt5. It's perplexing how a complete qt5 port would still rely on qt4.

Re: Python scripts not working

Posted: Wed Feb 06, 2019 10:55 pm
by spamatica
Ported the script at hand to PyQt5, please find it attached.
I'd propose creating the scripts folder here $HOME/.config/MusE/scripts/ and putting the file there. MusE will find it and display it in the menu.
The file needs to have the executable bit set.
E.g with: chmod +x RandomizeVelocityRelative
You of course need PyQt5 (for python3) installed to get it working.

I'll go through the rest and update them in the repository in a bit.

Re: Python scripts not working

Posted: Thu Feb 07, 2019 12:32 am
by funkmuscle
spamatica wrote:Ported the script at hand to PyQt5, please find it attached.
I'd propose creating the scripts folder here $HOME/.config/MusE/scripts/ and putting the file there. MusE will find it and display it in the menu.
The file needs to have the executable bit set.
E.g with: chmod +x RandomizeVelocityRelative
You of course need PyQt5 (for python3) installed to get it working.

I'll go through the rest and update them in the repository in a bit.
yep that works. thanx. will you be doing that for the other scripts?

Re: Python scripts not working

Posted: Thu Feb 07, 2019 4:02 pm
by spamatica
funkmuscle wrote: yep that works. thanx. will you be doing that for the other scripts?
Yes that was my plan.

Re: Python scripts not working

Posted: Thu Feb 07, 2019 6:01 pm
by spamatica
So, there. I've gone through all the midi scripts and updated them to PyQt5 where applicable. Added to git in the main/master branch. :)

Re: Python scripts not working

Posted: Thu Feb 07, 2019 6:04 pm
by funkmuscle
spamatica wrote:So, there. I've gone through all the midi scripts and updated them to PyQt5 where applicable. Added to git in the main/master branch. :)
thanx man! before I update, the version setup by milk for Arch, do you know if that's different?

Re: Python scripts not working

Posted: Thu Feb 07, 2019 7:00 pm
by empowerg
funkmuscle wrote:Michael tried a few things when I mentioned it to him on FB and he came to the conclusion it was PyQt4 thing.
OMG, I did forget completely about this, sorry. I should be in my holiday, but then stuff started happening and this slipped completely from my mind, sorry.

lg,
Michael