如何为 Python 2.7 安装 Pyside?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23576028/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 03:10:29  来源:igfitidea点击:

How to install Pyside for Python 2.7?

pythonqtqt4qt5pyside

提问by zzirrgrizz

Hey I am pretty new to Pyside and am not sure how to download it or Qt? I have a 64-bit Windows computer and am wondering what I need to download once I have downloaded Qt because there is a checklist for like Qt 5.3, Qt 5.2.1, etc. and I am not sure which to download because under those there are multiple options under them like MSCV2012 64-bit and mscv64-bit OpenGL. Basically I am just very lost on what I need and can't seem to find the answer. Could someone enlighten me?

嘿,我是 Pyside 的新手,不知道如何下载它或 Qt?我有一台 64 位 Windows 计算机,想知道下载 Qt 后我需要下载什么,因为有一个像 Qt 5.3、Qt 5.2.1 等的清单,但我不确定要下载哪个,因为在那里它们下有多个选项,如 MSCV2012 64 位和 mscv64 位 OpenGL。基本上我只是对我需要的东西很迷茫,似乎找不到答案。有人可以启发我吗?

Thanks!

谢谢!

回答by Andy

PySidedoes not yet support the Qt 5.x branch.

PySide尚不支持 Qt 5.x 分支。

Simply running pip install pysidewill install bindings that support the Qt 4.8 branch. Thus, you need that version of Qt.

只需运行即可pip install pyside安装支持 Qt 4.8 分支的绑定。因此,您需要该版本的 Qt。

回答by naheed

Install pip:

安装点:

  1. Download pip installer from hereand save it in a directory other than C.
  2. If you haven't set your python path: follow this.
  3. Open Command Prompt and cd to that directory where you saved the pip installer.
  4. run: python get-pip.py
  1. 这里下载 pip 安装程序并将其保存在 C 以外的目录中。
  2. 如果你还没有设置你的 python 路径:按照这个
  3. 打开命令提示符并 cd 到您保存 pip 安装程序的那个目录。
  4. 跑: python get-pip.py

Install pyside:

安装pyside:

  1. Close and Reopen Command Prompt.
  2. run: cd C:\Python27\Scripts
  3. run: pip install -U PySide
  1. 关闭并重新打开命令提示符。
  2. 跑: cd C:\Python27\Scripts
  3. 跑: pip install -U PySide

回答by lpapp

All the steps are mentioned in here, but for your convenience, here goes it inline:

所有步骤都在这里提到,但为了您的方便,这里是内联的:

Installing prerequisites

Install latest pip distribution: download get-pip.py [bootstrap.pypa.io] and run it using the python interpreter. Installing PySide on a Windows System

To install PySide on Windows you can choose from the following options:

安装先决条件

安装最新的 pip 发行版:下载 get-pip.py [bootstrap.pypa.io] 并使用 python 解释器运行它。在 Windows 系统上安装 PySide

要在 Windows 上安装 PySide,您可以从以下选项中进行选择:

Use pip [pypi.python.org] to install the wheel binary packages by issuing the command:
    pip install -U PySide
Use setuptools [pypi.python.org] to install the egg binary packages by issuing the command (deprecated):
    easy_install -U PySide
Download and install the packages from the PyPI page [pypi.python.org]

Provided binaries are without any other external dependencies. All required Qt libraries, development tools and examples are included.

提供的二进制文件没有任何其他外部依赖项。包括所有必需的 Qt 库、开发工具和示例。

Then, you can grab the Qt 4.8.6 version from here:

然后,您可以从这里获取 Qt 4.8.6 版本:

http://qt-project.org/downloads

http://qt-project.org/downloads

Please note that there is no installer for VS2012 off-hand, so you should use an older version or mingw. Alternatively, you could also build Qt 4 yourself.

请注意,没有现成的 VS2012 安装程序,因此您应该使用旧版本或 mingw。或者,您也可以自己构建 Qt 4。