2017-04-23 242 views
0

我花了几个小时(天)尝试在macOS sierra上安装PySide,但没有成功。我阅读并遵循谷歌搜索给出的许多解释,包括stackoverflow上的线程。PySide安装错误 - python 2.7 - QT5 - macOS Sierra

我的最新尝试使用PIP:

pip install PySide 

但我发现了一堆错误: 第1个是:

Qt QTGUI library not found. 
Qt QTXML library not found. 
Qt QTCORE library not found. 
CMake Error at ApiExtractor/CMakeLists.txt:82 (qt4_add_resources): 
Unknown CMake command "qt4_add_resources". 


-- Configuring incomplete, errors occurred! 
See also "/private/var/folders/jn/_85_tmmn3bjgrfdprd_l2c640000gn/T/pip-build-rjWn4w/PySide/pyside_build/py2.7-qt5.8.0-64bit-release/shiboken/CMakeFiles/CMakeOutput.log". 
error: Error configuring shiboken 

---------------------------------------- 
Failed building wheel for PySide 
Running setup.py clean for PySide 
Failed to build PySide 

,最后一个是:

命令“/usr/local/opt/python/bin/python2.7 -u -c”import setuptools, tokenize; 文件 = '/私有的/ var /文件夹/ JN/_85_tmmn3bjgrfdprd_l2c640000gn/T/PIP-积聚rjWn4w/PySide/setup.py'; F = GETATTR(标记化, '开',打开)(文件);代码= f.read()。replace('\ r \ n', '\ n'); f.close(); exec(编译(代码,文件,'exec'))“install - 记录/var/folders/jn/_85_tmmn3bjgrfdprd_l2c640000gn/T/pip-1xbkki-record/install-record.txt --single-version-external-managed -compile“在 /private/var/folders中出错,代码为1/jn/_85_tmmn3bjgrfdprd_l2c640000gn/T/pip-build-rjWn4w/PySide/

这些信息足以解释问题吗? 我想我的问题是:我做错了什么?我该如何做这项工作? (安装Pyside for python 2.7,qt5,macOS sierra。)

请让我知道如果我需要提供其他信息以便以某种方式获得帮助。

任何帮助将不胜感激!

感谢,

斯特凡

[编辑]链接冲泡后问题安装QT5的cmake的libxslt libxml2的

Warning: qt is a keg-only and another version is linked to opt. 
Use `brew install --force` if you want to install this version 
Warning: cmake-3.8.0 already installed 
Warning: libxslt is a keg-only and another version is linked to opt. 
Use `brew install --force` if you want to install this version 
Warning: libxml2 is a keg-only and another version is linked to opt. 
Use `brew install --force` if you want to install this version 
stefan-mbcn:export_hook stefan$ brew install --force qt5 cmake libxslt libxml2 
Warning: qt-5.8.0_2 already installed, it's just not linked. 
Warning: cmake-3.8.0 already installed 
Warning: libxslt-1.1.29 already installed, it's just not linked. 
Warning: libxml2-2.9.4_2 already installed, it's just not linked. 
stefan-mbcn:export_hook stefan$ 

回答

1

我假设你已经检查this thread on SO,其中指出,MacOS的塞拉不支持。你仍然可以尝试minigeeks解决方案。也看看wiki of pyside。如果您尚未尝试安装自制软件,请执行以下操作:

brew install qt5 cmake libxslt libxml2 
+0

谢谢@LaughU。我确实读过这个主题,并且尝试了你提到的命令,但是我收到了'链接'错误,我不知道如何在不破坏其他任何内容的情况下完全修复。 我编辑了原始问题并添加了链接部分。 –