Python scripts not working

MusE is a DAW for Linux with both MIDI and Audio editing. https://muse-sequencer.github.io

Moderators: MattKingUSA, khz, spamatica

Post Reply
User avatar
funkmuscle
Established Member
Posts: 2800
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 129 times
Been thanked: 31 times

Python scripts not working

Post 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 1090 times
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: Python scripts not working

Post 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.
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Python scripts not working

Post 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.
MusE DAW
User avatar
funkmuscle
Established Member
Posts: 2800
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 129 times
Been thanked: 31 times

Re: Python scripts not working

Post 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.
artofmusic
Established Member
Posts: 90
Joined: Mon Mar 17, 2014 8:01 pm

Re: Python scripts not working

Post by artofmusic »

Hopefully, They get ported to qt5. It's perplexing how a complete qt5 port would still rely on qt4.
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Python scripts not working

Post 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.
Attachments
RandomizeVelocityRelative.zip
(1.53 KiB) Downloaded 50 times
MusE DAW
User avatar
funkmuscle
Established Member
Posts: 2800
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 129 times
Been thanked: 31 times

Re: Python scripts not working

Post 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?
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Python scripts not working

Post by spamatica »

funkmuscle wrote: yep that works. thanx. will you be doing that for the other scripts?
Yes that was my plan.
MusE DAW
spamatica
Established Member
Posts: 573
Joined: Mon Feb 08, 2010 10:38 am
Has thanked: 80 times
Been thanked: 97 times

Re: Python scripts not working

Post 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. :)
MusE DAW
User avatar
funkmuscle
Established Member
Posts: 2800
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 129 times
Been thanked: 31 times

Re: Python scripts not working

Post 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?
empowerg
Established Member
Posts: 34
Joined: Sun Apr 03, 2016 12:36 pm
Contact:

Re: Python scripts not working

Post 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
Post Reply