简体   繁体   English

Windows 上的 PySide2

[英]PySide2 on windows

Does anyone know where I can find a pip-install for PySide2?有谁知道我在哪里可以找到 PySide2 的 pip 安装?

It's 2017 and I can't seem to find a pip install or site-package containing the binaries for PySide2.现在是 2017 年,我似乎找不到包含 PySide2 二进制文件的 pip 安装或站点包。 I prefer not to deal with downloading the source code and compiling it myself, as that usually ends up being a huge headache as it's never a smooth process.我不想处理下载源代码并自己编译它,因为这通常最终会让人头疼,因为它从来都不是一个顺利的过程。 Also considering it's highly likely someone else has already done it.还考虑到很可能其他人已经这样做了。 If I were to be honest here, if I attempted to compile it myself and errors popped up, I wouldn't really know where to begin solving them, nor do I want to spend time doing that.如果我在这里说实话,如果我试图自己编译它并弹出错误,我真的不知道从哪里开始解决它们,我也不想花时间这样做。

I just find it hard to believe I can't find it anywhere online or even in PIP when a lot of applications in the VFX industry are switching to PySide2.当 VFX 行业中的许多应用程序都转向 PySide2 时,我发现很难相信我在网上的任何地方甚至在 PIP 中都找不到它。

I hope someone can help me out.我希望有人可以帮助我。 Thanks谢谢

Same Problem...同样的问题...

So i tried to build it.所以我试图建立它。 But there are Problems building the WebKit.但是构建 WebKit 存在问题。

Hence my windows binaries are actually without a webkit binding.因此,我的Windows 二进制文件实际上没有 webkit 绑定。

You can obtain it through PyPI :您可以通过PyPI获取它:

pip install PySide2

or if it fails (most likely because your pip executable is bound to python 2) try:或者如果它失败(很可能是因为您的pip可执行文件绑定到 python 2)尝试:

pip3 install PySide2 

or even better:甚至更好:

python -m pip install Pyside2

This assumes that python is bound to Python 3, that way you're really sure about the Python version used, see Why you should use python -m pip .这假设python绑定到 Python 3,这样您就可以确定所使用的 Python 版本,请参阅为什么应该使用python -m pip

There are wheels available by Fredrik Averpil here built with Qt 5.6 . Fredrik Averpil这里有使用Qt 5.6构建的轮子。
Claudius Hansch's answer provides a wheel using Qt 5.9 . Claudius Hansch 的回答提供了一个使用Qt 5.9的轮子。

In any case, don't forget to either无论如何,不​​要忘记

  • set the QT_QPA_PLATFORM_PLUGIN_PATH environment variable as described here按照此处所述设置QT_QPA_PLATFORM_PLUGIN_PATH环境变量

or

  • create a qt.conf file in the folder of your python.exe with the content在您的python.exe文件夹中创建一个qt.conf文件,其中包含内容

    [Paths] Prefix = /dir_to_site-packages/PySide2 Binaries = /dir_to_site-packages/PySide2

PySide2 is now available on pypi so a simple PySide2 现在可以在pypi 上使用,所以很简单

pip install PySide2

should work on Windows, OSX, and linux!应该适用于 Windows、OSX 和 linux!

I use Python 3.7 on windows 10 pro, 64bit.我在 64 位 Windows 10 专业版上使用 Python 3.7。

Installing via pip failed for me.通过 pip 安装对我来说失败了。

I ended up downloading the wheel from qt directly我最终直接从qt下载了轮子

QT official download page QT官方下载页面

and install the downloaded wheel which worked fine.并安装下载的轮子,效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM