Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法从源生成qtermwidget_Python_Pyqt5_Python Sip - Fatal编程技术网

Python 无法从源生成qtermwidget

Python 无法从源生成qtermwidget,python,pyqt5,python-sip,Python,Pyqt5,Python Sip,我试图从源代码构建,但它给了我错误。 我已经成功地从pip3和apt构建并安装了pyqt5: sudo -H pip3 install -U pyqt5 pyqtwebengine sudo apt install python3-sip-dev python3-pyqt5 然后我运行了这个: mkdir -p /tmp/EAF && cd /tmp/EAF git clone https://github.com/lxqt/qtermwidget cd qtermwidg

我试图从源代码构建,但它给了我错误。
我已经成功地从pip3和apt构建并安装了pyqt5:

sudo -H pip3 install -U pyqt5 pyqtwebengine
sudo apt install python3-sip-dev python3-pyqt5
然后我运行了这个:

mkdir -p /tmp/EAF && cd /tmp/EAF
git clone https://github.com/lxqt/qtermwidget  
cd qtermwidget  
mkdir build && cd build  
cmake .. -DQTERMWIDGET_BUILD_PYTHON_BINDING=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr
而且效果很好。但当我运行
make
命令时,它会给出以下错误:

[ 87%] Built target qtermwidget5
Byte-compiling /tmp/EAF/qtermwidget/build/pyqt//__init__.py to /tmp/EAF/qtermwidget/build/pyqt//__pycache__/__init__.cpython-36.pyc
[ 87%] Built target __tmp_EAF_qtermwidget_build_pyqt____pycache_____init__.cpython-36.pyc
[ 89%] Generating sip/sipQTermWidgetpart0.cpp, sip/sipQTermWidgetpart1.cpp, sip/sipQTermWidgetpart2.cpp, sip/sipQTermWidgetpart3.cpp, sip/sipQTermWidgetpart4.cpp, sip/sipQTermWidgetpart5.cpp, sip/sipQTermWidgetpart6.cpp, sip/sipQTermWidgetpart7.cpp

sip: Unable to find file "QtGui/QtGuimod.sip"
pyqt/CMakeFiles/python_module_QTermWidget.dir/build.make:62: recipe for target 'pyqt/sip/sipQTermWidgetpart0.cpp' failed
make[2]: *** [pyqt/sip/sipQTermWidgetpart0.cpp] Error 1
make[2]: *** Deleting file 'pyqt/sip/sipQTermWidgetpart0.cpp'
CMakeFiles/Makefile2:179: recipe for target 'pyqt/CMakeFiles/python_module_QTermWidget.dir/all' failed
make[1]: *** [pyqt/CMakeFiles/python_module_QTermWidget.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

我正在初级操作系统5.1 Hera中使用
gcc(Ubuntu 7.4.0-1ubuntu1~18.04.1)7.4.0和
cmake版本3.16.0和
GNU Make 4.1。我曾经尝试从源代码构建
sip
pyqt5
,但没有为我改变任何东西

Ubuntu发布的PyQt5没有共享编译QTermWidget所需的.sip,因此需要手动编译sip和PyQt5。看来你试过了,但没用,因为你用错了旗子。考虑到上述情况,我分析了如何在ArchLinux中编译sip、pyqt5和qtermwidget,并实现了一个允许我编译qtermwidget的

因此,考虑到上述因素,该程序为:

sudo apt-get update && apt-get install \
    -y --no-install-recommends \
    build-essential \
    git \
    ca-certificates \
    wget \
    cmake \
    pkg-config \
    python3-dev \
    libglib2.0-dev \
    qt5-default \
    qttools5-dev

mkdir -p /tmp/EAF

cd /tmp/EAF && \
    git clone https://github.com/lxqt/lxqt-build-tools.git \
    && cd lxqt-build-tools \
    && mkdir build && cd build \
    && cmake .. \
    && make && sudo make install

cd /tmp/EAF && \
    wget https://www.riverbankcomputing.com/static/Downloads/sip/4.19.19/sip-4.19.19.tar.gz && \
    tar xvzf sip-4.19.19.tar.gz && \
    cd sip-4.19.19 && \
    python3 configure.py --sip-module PyQt5.sip && \
    make && \
    sudo make install

cd /tmp/EAF && \
    wget https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.13.2/PyQt5-5.13.2.tar.gz && \
    tar xvzf PyQt5-5.13.2.tar.gz && \
    cd PyQt5-5.13.2 && \
    python3 configure.py --confirm-license && \
    make && \
    sudo make install

cd /tmp/EAF && \
    git clone https://github.com/lxqt/qtermwidget \
    && cd qtermwidget \
    && mkdir build && cd build \
    && cmake .. -DQTERMWIDGET_BUILD_PYTHON_BINDING=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/lib \
    && make && sudo make install