簡體   English   中英

無法在Mac OSX 10.11.6上安裝pyqt4

[英]Cannot install pyqt4 on Mac OSX 10.11.6

我正在嘗試安裝一個python2.7程序,它將PyQt作為依賴項。 我的mac默認為3.5.2,因此我使用virtualenv和python 2.7創建了一個虛擬環境。

還有很多其他依賴項,但除了PyQt之外它們都在工作。 我已經下載並解壓縮了源代碼,但輸入了

(venv)$ python configure-ng.py --qmake ~/anaconda/bin/qmake-qt4 --verbose

回報

Querying qmake about your Qt installation...
Determining the details of your Qt installation...
/Users/evansmith/anaconda/bin/qmake-qt4 -spec macx-g++ -o qtdetail.mk qtdetail.pro
make -f qtdetail.mk
g++ -c -pipe -O2 -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I../../../anaconda/lib/qt4/mkspecs/macx-g++ -I. -I../../../anaconda/include/qt4/QtCore -I../../../anaconda/include/qt4 -I. -o qtdetail.o qtdetail.cpp
g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o qtdetail.app/Contents/MacOS/qtdetail qtdetail.o    -L/Users/evansmith/anaconda/lib -lQtCore -L/Users/evansmith/anaconda/lib 
Undefined symbols for architecture x86_64:
  "__Unwind_Resume", referenced from:
      _main in qtdetail.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [qtdetail.app/Contents/MacOS/qtdetail] Error 1
Error: Failed to determine the detail of your Qt installation. Try again using
the --verbose flag to see more detail about the problem.

在你說“brew pyqt”之前,我聽說自制軟件與virtualenv不兼容。 我應該用它嗎?

我唯一能想到的是virtualenv python無法訪問/ anaconda / bin /中的qmake文件。 有辦法解決這個問題嗎?

看起來你已經在使用Anaconda了。

只需使用conda創建一個新環境

conda create -n py27 python=2.7

激活它:

source activate py27

並安裝PyQt 4:

conda install pyqt

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM