egara / buttermanager

ButterManager is a BTRFS tool for managing snapshots, balancing filesystems and upgrading the system safetly.
GNU General Public License v3.0
129 stars 6 forks source link

Missing dependency for Arch "No module named 'PyQt5.sip'" #13

Closed friday closed 4 years ago

friday commented 4 years ago
python /opt/buttermanager/buttermanager/buttermanager.py 
Traceback (most recent call last):
  File "/opt/buttermanager/buttermanager/buttermanager.py", line 21, in <module>
    import filesystem.filesystem
  File "/opt/buttermanager/buttermanager/filesystem/filesystem.py", line 25, in <module>
    import util.utils
  File "/opt/buttermanager/buttermanager/util/utils.py", line 36, in <module>
    import window.windows
  File "/opt/buttermanager/buttermanager/window/windows.py", line 26, in <module>
    from PyQt5.QtWidgets import QDesktopWidget, QDialog, QMainWindow, QFileDialog
ModuleNotFoundError: No module named 'PyQt5.sip'

I tried installing the PyQt5 package, but it wasn't enough.

There's a package named python2-sip-pyqt5, but none for python 3.

egara commented 4 years ago

Hi @friday Thank you very much for reporting the issue. A few questions:

Thank you very much :)

friday commented 4 years ago

I'm using Arch (sorry, put it in the title, but easy to miss) with Gnome as DE

egara commented 4 years ago

Hi @friday again.

You are right! Distro was in the main title. I didn't see it! ;P

I've been checking the dependencies I have installed in my two computers (both Arch, one with KDE and the other one with XFCE) and I see I have these two packages:

python-sip (4.19.19-4) and python-sip-pyqt5 (4.19.19-3). Could you test if installing only the second one the application works? If it is not enough, try installing the first one too and tell me the results.

If ButterManager runs, I should add those dependencies in the AUR package. Thank you very much and I'll wait for your results!

friday commented 4 years ago

python-sip-pyqt5 doesn't exist in main repos or aur. Apparently it was in extra, but not any more. https://www.archlinux.org/packages/extra/x86_64/python-sip-pyqt5/

I tried installing python-sip, sip and sip5, but it doesn't change anything.

egara commented 4 years ago

Really strange! Why has this package been removed? :o

Ok, let's try this:

And try again. Let's see if this works. Thanks!

friday commented 4 years ago

I had to install both PyQt5 and PyQt5.sip pip install --user PyQt5 PyQt5.sip. The python-pyqt5 package didn't work after I installed PyQt5.sip via pip:

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

With python2 I could import the module if I installed python2-pyqt5 (which depends on python2-sip-pyqt5).

egara commented 4 years ago

Hi again!

I don't understand very well. So, if you install PyQt5 and PyQt5-sip via pip the application works?

egara commented 4 years ago

Hi again @friday I've been installing Arch with GNOME (via EndevourOS) in VirtualBox and you are right, since the python-pyqt5-sip has been removed, the application is not running anymore. I have been able to run it creating a venv (virtual environment) and installing there all the python modules it needs so I'm going to try to modify the PKGBUILD and the initial script in order to do all the needed stuff in a transparent way for the user. If you want to test the application while I figure all this out, you could copy

sudo chmod 777 -R /opt/buttermanager
sudo nano /opt/buttermanager/buttermanager/requirements.txt

And paste this:

PyQt5>=5.10.1
PyQt5-sip>=12.7.0
PyYAML>=4.2b1
sip>=4.19.8

Then

cd /opt/buttermanager/buttermanager
python3 -m venv env
source env/bin/activate
pip install -r requirements.txt
python buttermanager.py

This should be enought for, at least, running the application while a fix this issue. Try it an let me know :)

Thanks!

friday commented 4 years ago

Hey! I don't have much time currently, and also don't depend on Buttermanager, so I prefer to wait until it's fixed.

egara commented 4 years ago

Hi @friday
Finally I have completelly repackaged the application and it is published in AUR version 1.7-2 of buttermanager. I had to build a virtual environment with all the modules and dependencies obtained from pip because of the problems related to native packaged library python-pyqt5-sip, which is not included anymore. Because of this virtual environment, the size of the package has increased, but the application should work without any problem now. Could you test it when you have time?

Thank you very much!

friday commented 4 years ago

That did the trick :+1:

Were you also getting cropped text labels when you tested in Gnome btw? If not I could create a new issue and post screenshots. (Nevermind, I figured out why and created a new issue #14)

I'm very new to BTRFS and decided to look at GUIs to get started. I will end up using systemd jobs for maintenance though, so don't put too much time on me specifically.