【问题标题】:pip install -U PySide errorpip install -U PySide 错误
【发布时间】:2016-01-17 05:30:48
【问题描述】:

有没有人知道在运行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 的说明可能已经过时了。如果有人真的让这个工作,请上传食谱。谢谢你。

【问题讨论】:

  • MacOS X 二进制文件尚未针对 PySide 版本 1.2.4 发布。您可以在pyside.readthedocs.org/en/latest/building/macosx.html 处按照您的说明构建二进制文件,或者您可以使用以前版本 1.2.2 中的官方二进制文件,使用“pip install pyside==1.2.2”
  • 还是同样的错误。两个多月来一直在努力解决这个问题。
  • 这有什么更新吗?我在 el capitan 上有同样的错误
  • 我实际上还在等待对此的回应。我很惊讶它仍然没有得到答复。我建议您发布您自己的类似问题,并将我链接到它(如果可能的话)。
  • @user1387717 El Capitan 更新发布在上面...

标签: python macos qt pyside


【解决方案1】:

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

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

$ brew doctor

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

$ brew link cmake

之后,我又试了一次:

$ pip3.4 install -U PySide

它工作正常,现在已安装并且工作正常。希望这会有所帮助。

【讨论】:

  • 花了将近一年的时间才弄清楚这一点,但值得等待。欢迎来到堆栈溢出!希望能见到你。
【解决方案2】:

我尝试了所有方法,但无法使用 pip。最后我尝试了自制软件:

$ brew install pyside

而且效果很好!

我使用的是 Mac OS X 10.11 (El Capitan)。

【讨论】:

  • 是的,没关系。它也适用于我,我只是想提请注意,它不适用于 pip 安装,如网站上的说明。
  • 看起来它已被迁移到自制骨场,brew install homebrew/boneyard/pyside :'(
【解决方案3】:

截至 2018 年 6 月,在 MacOS High Sierra 上,您仍然会遇到此问题。

  • 请务必安装 qt 4.8.7,brew install qt 默认会安装 qt5,它与 PySide 不兼容,如果您确实安装了 qt5,请将其卸载然后安装 qt4。

    brew tap cartr/qt4

    brew install qt@4

  • 如果未检测到 qmake,请在 bashrc 中为 qmake 创建一个别名 alias qmake="/usr/local/Cellar/qt@4/4.8.7_5/bin/qmake"

  • pip install pyside 现在应该可以工作了,大约需要 30 分钟才能完成。所以,请耐心等待。

【讨论】:

    【解决方案4】:

    要在您的系统上安装二进制 Python 模块,您需要使用构建工具正确配置您的 OS X 机器。这意味着使用最新的 OS X 版本和安装了命令行工具的最新 XCode。

    我看到部署目标 10.5 对我来说似乎很害怕,因为当前的 OS X 版本是 10.11 ... 听起来 SDK 太旧了。

    【讨论】:

      【解决方案5】:

      我通过将 CMake 添加到我的路径解决了第二个问题:

      $> PATH="/Applications/CMake.app/Contents/bin":"$PATH"

      这样实际上可以找到 CMake。我仍然被第一个问题难住了。事实上,我在处理 CMake 之后得到了第一个问题。

      这是我的设置:

      • Mac OS X (10.10.5)
      • Python 2.7.10
      • 点 8.0.2
      • Qt 4.8.6
      • CMake 3.6.0-rc02
      • Xcode Commad Lines 工具已安装。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-08-26
        • 1970-01-01
        • 1970-01-01
        • 2012-09-08
        • 2021-08-23
        相关资源
        最近更新 更多