【发布时间】:2013-11-28 16:05:43
【问题描述】:
我正在拼命安装 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 没有给我任何错误,但是当我尝试以超级用户 (sudo python3) 运行 Python 并尝试 dir(PyQt5) Python 崩溃时。请注意,已找到该包。
在某处阅读我需要 Python Development Header。所以我从 OSx 上的源代码编译了 Python3.3.2。这给了我没有比这更好的了..
窗口
没试过这么多。似乎使用二进制 GUI 安装程序安装。这里的问题是dir(PyQt5) 列出了一些默认的 Python 内容(带有下划线),但没有来自 Qt*..
对 Windows 不太了解,我也不想(VM 真的很慢)。
Ubuntu
安装过程中没有错误或警告(与 OSx 安装过程中使用的命令完全相同),但是当我尝试 dir(PyQt5) 时 Python 也会中断。没有错误或任何错误。
我已经尝试搜索我遇到的每一个错误,一些结果让我重新开始。不过,这是我卡住并可能停止的地方。如果有人知道,请帮忙。
【问题讨论】:
-
试试
python configure.pymakemake install这对我来说就像 3.3.2 linux 上的魅力一样,完全没有错误。如果它不起作用,它必须与依赖关系有关。 -
再次检查您的 ubuntu 安装。
dir(PyQt5)具有误导性,因为它只是一个包命名空间,不会显示任何有趣的东西。试试from PyQt5 import QtCore; dir(QtCore)。 -
这是一个在 OS X 上安装的好文章:danmarner.com/2014/04/23/…