gpt4 book ai didi

python - PyQt5 不会为 Python 3 安装

转载 作者:行者123 更新时间:2023-12-01 05:32:01 25 4
gpt4 key购买 nike

我正在拼命安装 PyQt5。到目前为止,我已经在 OSx Mavericks、Ubuntu VM 和 W7 VM 上进行了尝试。似乎什么都不起作用。这是我尝试过的。

操作系统

我尝试过自制

brew update
brew install PyQt5

brew install 命令的输出:

==> Installing dependencies for pyqt5: qt5, sip    
==> Installing pyqt5 dependency: qt5
==> Downloading http://download.qt-project.org/official_releases/qt/5.1/5.1.1/si
Already downloaded: /Library/Caches/Homebrew/qt5-5.1.1.tar.gz
==> ./configure -prefix /usr/local/Cellar/qt5/5.1.1 -system-zlib -confirm-licens
==> make
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -stdlib=libc++ -mmacosx-version-min=10.7 -single_module -dynamiclib -o libqsqlite.dylib .obj/release-shared/smain.o .obj/release-shared/qsql_sqlite.o .obj/release-shared/sqlite3.o .obj/release-shared/moc_qsql_sqlite_p.o -F/private/tmp/qt5-jmbp/qt-everywhere-opensource-src-5.1.1/qtbase/lib -framework QtSql -framework QtCore
mv -f libqsqlite.dylib ../../../../plugins/sqldrivers/
make[2]: *** [sub-plugins-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtbase-make_first] Error 2

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

These open issues may also help:
https://github.com/mxcl/homebrew/issues/23699
https://github.com/mxcl/homebrew/issues/23480
https://github.com/mxcl/homebrew/pull/22283
https://github.com/mxcl/homebrew/issues/23806

我已尝试了所有问题并进行了故障排除。似乎没有什么帮助。

我也尝试过手动安装: sudo python3 configure.py --qmake=/Users/Thomas/Qt/5.1.1/clang_64/bin/qmake --sip=/Users/Thomas/Downloads/sip-4.15.3/sipgen/sip

工作正常。然后,当我尝试 sudo make 时,它​​不断给出:

    In file included from ../../../../Qt/5.1.1/clang_64/include/QtCore/qglobal.h:70:    
../../../../Qt/5.1.1/clang_64/include/QtCore/qsystemdetection.h:243:6: warning:
"This version of OS X is unsupported" [-W#warnings]
# warning "This version of OS X is unsupported"
^
1 warning generated.

我认为这个警告并不重要,因为 qglobal.h 将最大版本定义为 10.8,而我运行的是 10.9。

sudo make install 不会给我任何错误,但是当我尝试以 super 用户身份运行 Python (sudo python3) 时,并尝试 dir(PyQt5 ) Python 崩溃。请注意,已找到该包。

在某处读到我需要 Python 开发 header 。所以我在 OSx 上从源代码编译了 Python3.3.2。这没有给我带来更好的结果..

窗口

还没有尝试过这么多。似乎使用二进制 GUI 安装程序进行安装。这里的问题是 dir(PyQt5) 列出了一些默认的 Python 内容(带下划线),但没有任何来自 Qt* 的实际内容。对 Windows 不太了解,也不想了解(VM 真的很慢)。

Ubuntu

安装过程中没有错误或警告(与 OSx 安装过程中使用的命令完全相同),但当我尝试 dir(PyQt5) 时,Python 也会中断。没有错误或任何情况。

我尝试搜索遇到的每个错误,一些结果让我再次前进。不过,这就是我陷入困境并可能停止的地方。如果有人知道的话请帮忙。

最佳答案

目前不可能通过标准/简单的方式在 Mac OS X(包括 Yosemite)中安装 PyQt5。我已经尝试了所有方法,但只有一件事有效 - 编译并安装它。在这个 Action 这里没什么难做的,我写了一个gist包含在 Yosemite 上安装 pyqt5 的步骤。

关于python - PyQt5 不会为 Python 3 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19998105/

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