Install PyQt5 on Raspberry for Python3.6

后端 未结 5 1959
北荒
北荒 2021-01-22 07:50

Since I found no answer for my question, neither in older posts nor in other forums, I want to ask the stackoverflow community for advice.

I am using a raspberry pi 3B

相关标签:
5条回答
  • 2021-01-22 07:54

    In my case it helped to update pip from verion 18 to the newest, in my case 20.2 (python -m pip install --upgrade pip) and then do a pip install PyQt5.

    0 讨论(0)
  • 2021-01-22 07:54

    The instructions used in the accepted answer did not work for me. I think it's simply because they are outdated. I wanted to post the list of commands that did work for me. I'm running a Pi 400 with the latest version of Raspbian as of 12/20/2020. I used the default python3 rather than python3.6.

    Here is the modified list of commands that worked for me:

    sudo apt-get install qt5-default
    sudo apt-get install sip-dev
    
    cd /usr/src
    sudo wget https://www.riverbankcomputing.com/static/Downloads/sip/sip-5.5.1.dev2011271026.tar.gz
    sudo tar xzf sip-5.5.1.dev2011271026.tar.gz
    cd sip-5.5.1.dev2011271026
    sudo python3 setup.py build
    sudo python3 setup.py install
    
    sudo wget https://files.pythonhosted.org/packages/28/6c/640e3f5c734c296a7193079a86842a789edb7988dca39eab44579088a1d1/PyQt5-5.15.2.tar.gz
    sudo tar xzf PyQt5-5.15.2.tar.gz
    cd PyQt5-5.15.2
    sudo python3 configure.py
    sudo make
    sudo make install
    
    
    0 讨论(0)
  • 2021-01-22 07:56

    Seems like they moved some things around. This seems to work, as far as getting things, and compiling them. It takes a long time to build.

    For the associated designer, look at:

    QtDesigner for Raspberry Pi

    sudo apt-get update
    sudo apt-get install qt5-default
    sudo apt-get install sip-dev
    
    cd /usr/src
    sudo wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.23/sip-4.19.23.tar.gz
    sudo tar xzf sip-4.19.23.tar.gz
    cd sip-4.19.23
    sudo python3 configure.py --sip-module PyQt5.sip
    sudo make
    sudo make install
    
    cd /usr/src
    sudo wget https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.13.2/PyQt5-5.13.2.tar.gz
    sudo tar xzf PyQt5-5.13.2.tar.gz
    cd PyQt5-5.13.2
    sudo python3  configure.py
    sudo make
    sudo make install
    
    0 讨论(0)
  • 2021-01-22 07:57

    Today I found the solution. The steps below worked for me, without any error. The whole process took almost two hours.

    sudo apt-get update
    sudo apt-get install qt5-default
    sudo apt-get install sip-dev
    
    cd /usr/src
    sudo wget https://www.riverbankcomputing.com/static/Downloads/sip/sip-4.19.14.tar.gz
    sudo tar xzf sip-4.19.14.tar.gz
    cd sip-4.19.14
    sudo python3.6 configure.py --sip-module PyQt5.sip
    sudo make
    sudo make install
    
    cd /usr/src
    sudo wget https://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-5.12.tar.gz
    sudo tar xzf PyQt5_gpl-5.12.tar.gz
    cd PyQt5_gpl-5.12
    sudo python3.6 configure.py
    sudo make
    sudo make install
    
    0 讨论(0)
  • 2021-01-22 08:00

    Can't comment due to reputation but I would add to Christ Troutner's useful updated answer, that in case users get a No module named 'PyQt5.sip' error, try --sip-module PyQt5.sip during configure, per the docs:

    Note

    When building PyQt5 v5.11 or later you must configure SIP to create a private copy of the sip module using a command line similar to the following:

    python configure.py --sip-module PyQt5.sip

    If you already have SIP installed and you just want to build and install the private copy of the module then add the --no-tools option.

    0 讨论(0)
提交回复
热议问题