gpt4 book ai didi

python - 无法从源代码构建 qtermwidget

转载 作者:行者123 更新时间:2023-12-05 05:07:17 27 4
gpt4 key购买 nike

我正在尝试构建 qtermwidget来自源代码,但它给了我错误。
我已经成功构建了 lxqt-build-tools然后从 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

我正在使用 gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0cmake 版本 3.16.0GNU Make 4.1 在 elementary OS 5.1 Hera 中。我曾经尝试从源代码构建 sippyqt5,对我来说没有任何改变。

最佳答案

Ubuntu发布的PyQt5没有共享编译QTermWidget所必需的.sip,所以需要手动编译sip和pyqt5。似乎您尝试过但没有用,因为您似乎使用了错误的标志。考虑到上述情况,我分析了 sip、pyqt5 和 qtermwidget 如何在 Arch Linux 中编译并设法实现 Dockerfile这使我能够编译 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

关于python - 无法从源代码构建 qtermwidget,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59229716/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com