python - pip install -U PySide 错误

标签 python macos qt pyside

有谁知道如何按照官方网站说明在运行 pip install -U PySide 时避免以下错误:https://pypi.python.org/pypi/PySide/#installing-pyside-on-a-mac-os-x-system

请注意,我已经成功地完成了brew install qt

You are using pip version 7.0.3, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting PySide
  Using cached PySide-1.2.4.tar.gz
Installing collected packages: PySide
  Running setup.py install for PySide
    Complete output from command /Applications/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-0r7hrI-record/install-record.txt --single-version-externally-managed --compile:
    Removing /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_package
    running install
    running build
    Python architecture is 64bit
    Inserting path "/private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_install/py2.7-qt4.8.6-64bit-release/bin" to environment
    ==============================
    Package version: 1.2.4
    Build type: Release
    Build tests: False
    ---
    Make path: /usr/bin/make
    Make generator: Unix Makefiles
    Make jobs:
    ---
    Script directory: /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide
    Sources directory: /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/sources
    Build directory: /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_build/py2.7-qt4.8.6-64bit-release
    Install directory: /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_install/py2.7-qt4.8.6-64bit-release
    Python site-packages install directory: /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_install/py2.7-qt4.8.6-64bit-release/lib/python2.7/site-packages
    ---
    Python executable: /Applications/anaconda/bin/python
    Python includes: /Applications/anaconda/include/python2.7
    Python library: /Applications/anaconda/lib/libpython2.7.dylib
    Python prefix: /Applications/anaconda
    Python scripts: /Applications/anaconda/bin
    ---
    Qt qmake: /Applications/anaconda/bin/qmake
    Qt version: 4.8.6
    Qt bins: /Applications/anaconda/bin
    Qt plugins: /Applications/anaconda/plugins
    ---
    OpenSSL libs: None
    ==============================
    Creating build folder /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_build/py2.7-qt4.8.6-64bit-release...
    Creating install folder /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_install/py2.7-qt4.8.6-64bit-release...
    Building module shiboken...
    Creating module build folder /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_build/py2.7-qt4.8.6-64bit-release/shiboken...
    Configuring module shiboken (/private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/sources/shiboken)...
    Running process: /usr/local/bin/cmake -G "Unix Makefiles" -DQT_QMAKE_EXECUTABLE=/Applications/anaconda/bin/qmake -DBUILD_TESTS=False -DDISABLE_DOCSTRINGS=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_install/py2.7-qt4.8.6-64bit-release /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/sources/shiboken -DPYTHON_EXECUTABLE=/Applications/anaconda/bin/python -DPYTHON_INCLUDE_DIR=/Applications/anaconda/include/python2.7 -DPYTHON_LIBRARY=/Applications/anaconda/lib/libpython2.7.dylib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=yes -DALTERNATIVE_QT_INCLUDE_DIR=/Applications/anaconda/include
    /usr/local/bin/cmake -G Unix Makefiles -DQT_QMAKE_EXECUTABLE=/Applications/anaconda/bin/qmake -DBUILD_TESTS=False -DDISABLE_DOCSTRINGS=True -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_install/py2.7-qt4.8.6-64bit-release /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/sources/shiboken -DPYTHON_EXECUTABLE=/Applications/anaconda/bin/python -DPYTHON_INCLUDE_DIR=/Applications/anaconda/include/python2.7 -DPYTHON_LIBRARY=/Applications/anaconda/lib/libpython2.7.dylib -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=yes -DALTERNATIVE_QT_INCLUDE_DIR=/Applications/anaconda/include
    -- The C compiler identification is AppleClang 7.0.0.7000072
    -- The CXX compiler identification is AppleClang 7.0.0.7000072
    CMake Error at /usr/local/Cellar/cmake/3.3.0/share/cmake/Modules/Platform/Darwin.cmake:76 (message):
      CMAKE_OSX_DEPLOYMENT_TARGET is '10.5' but CMAKE_OSX_SYSROOT:

       ""

      is not set to a MacOSX SDK with a recognized version.  Either set
      CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
      empty.
    Call Stack (most recent call first):
      /usr/local/Cellar/cmake/3.3.0/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
      CMakeLists.txt:2 (project)


    -- Configuring incomplete, errors occurred!
    See also "/private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/pyside_build/py2.7-qt4.8.6-64bit-release/shiboken/CMakeFiles/CMakeOutput.log".
    error: Error configuring shiboken

    ----------------------------------------
Command "/Applications/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-0r7hrI-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/dy/ttgqhqqx3g9bsbsnqnxsk2z80000gq/T/pip-build-CPxEmt/PySide

更新(2016 年 3 月 16 日):

我最近拿到了完全更新的 Mac OS X 10.11 (El Capitan)。我继续成功 brew install qt,然后再次尝试 pip install -U PySide(按照这些说明:https://pypi.python.org/pypi/PySide/#installing-pyside-on-a-mac-os-x-system)。不幸的是,我再次收到错误:

Collecting PySide
  Downloading PySide-1.2.4.tar.gz (9.3MB)
    100% |████████████████████████████████| 9.3MB 162kB/s 
Installing collected packages: PySide
  Running setup.py install for PySide ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/km/x8ww58k15h74q73fvrbqxym40000gp/T/pip-build-ozZWDt/PySide/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/km/x8ww58k15h74q73fvrbqxym40000gp/T/pip-YVPqB6-record/install-record.txt --single-version-externally-managed --compile:
    Removing /private/var/folders/km/x8ww58k15h74q73fvrbqxym40000gp/T/pip-build-ozZWDt/PySide/pyside_package
    running install
    running build
    Python architecture is 64bit
    error: Failed to find cmake. Please specify the path to cmake with --cmake parameter.

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/km/x8ww58k15h74q73fvrbqxym40000gp/T/pip-build-ozZWDt/PySide/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/km/x8ww58k15h74q73fvrbqxym40000gp/T/pip-YVPqB6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/km/x8ww58k15h74q73fvrbqxym40000gp/T/pip-build-ozZWDt/PySide/

距离我最初的帖子已经好几个月了,从投票数来看,我不是唯一遇到这个问题的人。因此,我开始怀疑可能是对 https://pypi.python.org/pypi/PySide/#installing-pyside-on-a-mac-os-x-system 的说明已经过时了。如果有人真的让这个工作,请上传食谱。谢谢你。

最佳答案

首先,这是我第一次在stackoverflow上回答问题,所以请耐心等待我..

为了安装pyside,我安装了cmake,我遇到了和你一样的问题。那么,我尝试使用自制软件:

$ brew doctor

它说安装了cmake但没有链接。为了链接它,我不得不用自制软件运行:

$ brew link cmake

在那之后,我再次尝试:

$ pip3.4 install -U PySide

它有效,现在已安装并且有效。希望这对您有所帮助。

关于python - pip install -U PySide 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33204753/

相关文章:

Python Tkinter 列表框 : fire off a function on change?

objective-c - 在 Cocoa 中以平铺图案绘制图像

c++ - 如何在不使用任何迭代器的情况下获取 Qt 中 QList 的最小值和最大值?

python - 文本冒险游戏收到 AttributeError

python - 获取 Instagram 关注者

swift - 获取空指针异常尝试在 OSX 上使用 swift 从当前事件窗口获取边界

c++ - 如何在 .pro 文件中为 TARGET 使用空格和尖括号

c++ - 链接器错误让我头疼

python - Python中本地网络的IP地址/主机名列表

objective-c - Objective C,圆角自定义窗口?