falkTX / Cadence

Collection of tools useful for audio production
GNU General Public License v2.0
370 stars 81 forks source link

cadence fail to run with "No module named 'PyQt5'" #214

Open domichel opened 6 years ago

domichel commented 6 years ago

On gentoo, I get the following error when running candence:

# cadence 
Traceback (most recent call last):
  File "/usr/share/cadence/src/cadence.py", line 25, in <module>
    import PyQt5
ImportError: No module named 'PyQt5'

Gentoo install several python3 versions. Into my system, python3.4 is the default and PyQt5 is installed only for python3.5, which give that error. To solve this, I changed all the "python3" tests and calls to "python3.5" into the scripts in src/data.

cadence is not into gentoo at that time, but 2 ebuilds allow to install it. One is in the new audio-overlay https://github.com/gentoo-audio/audio-overlay/tree/master/media-sound/cadence Obviously it will exhibit this error on my system at that time.

The other is mine, which install cadence with all your files, and is part of the old pro-audio overlay: https://svnweb.tuxfamily.org/listing.php?repname=proaudio%2Fproaudio&path=%2Ftrunk%2Foverlays%2Fproaudio%2Fmedia-sound%2Fcadence%2F&#abd433747895e80c7355940e27508f087 It will fix this issue.

domichel commented 6 years ago

I don't know what is best or possible. The best fix would be to not have to patch the launcher scripts in data. But if not possible, you can add a work about the audio-overlay in the doc.

falkTX commented 6 years ago

So gentoo has several versions of python3 installed, but only one of them has pyqt modules. Sounds like a dependency problem, the cadence package needs to depend on the default python3-pyqt5 and not a specific package like python3.4-pyqt5

domichel commented 6 years ago

The correct dependencies are installed in my system. The issue is related to the way gentoo deal with python. Several python3 versions can be installed at the same time, and root can set the default version for the system. With a shebang of /usr/bin/python3, cadence will use that default version. With a shebang of /usr/bin/python3.x, it will use python3.x instead of the default version. It is why the shebang must be changed. I can do it with the ebuil, so it's fine. But it is more:

For PyQt5, portage install by default only the PyQt5 module for only one python version. If root doesn't change PyQt5 default, it will be for python3.5. This is a setting in portage, which can be changed globally or on a package basis, and which is independent from the system python version. That imply root can set portage to install the PyQt5 modules for 1 or several python 3 versions, and can do that for any package which support different python versions.

To achieve that, portage install the python modules in /usr/${lib_dir}/${python3_version}

cadence install its python stuf in $PREFIX/share/cadence/src, which imply if we want cadence to support several python3 version, additional patching is need, that in order for cadence to use ${PREFIX}/lib64/${python3_version}/cadence instead of $PREFIX/share/cadence/src.

domichel commented 6 years ago

No matter, I will make my ebuild to use only python3.5. It is the default python3 version in gentoo, and cadence work fine with it. Sorry for the noise.