install PySide2 on python 2.7

僤鯓⒐⒋嵵緔 提交于 2021-01-29 04:03:42

问题


Trying for days but can't install PySide2 on python 2.7.15 while got no problem on python 3.7. On Qt for python(which is the project name for the module PySide2) website at is written explicitly that python 2.7 is supported so that should be no problem.

I succeeded installing PySide2 on python 3 using:

pip install PySide2

then i tried installing PySide2 on python 2 using:

python -m  pip install PySide2

which yelled error:

ERROR: Could not find a version that satisfies the requirement PySide2(from versions: none)

which means there is no such module for 2.7 even though at is written in Qt for python website that python 2.7 is suported.

also tried installing using Pycharm directly and failed with the the same error.

there is no even a single tutorial showing fully how to install PySide2 on python 2.7.


回答1:


The pip install approach pulls the wheels from the pypi page. If you look at the available wheels for cp27 (Python 2.7), there are only wheels for Linux and MacOS platform. I'm assuming you are using a Windows Platform, which returns the error message as you have shown.

If there is no support on the pypi platform, your only way is to build PySide2 from the source on your platform. This document shows how to build from source. However, according to this very document, it does not support Python 2.7 interpreter.

Note: Python 2.7 interpreter is not supported. The official Python 2.7 binary package offerred on the official website is built using MSVC 2007, while the Qt libraries are built using MSVC 2015/2017. If you intend to use Python 2.7, build the interpreter yourself with MSVC 2015 or later, and build Qt for Python with it.

The bolded statement is your answer.



来源:https://stackoverflow.com/questions/57384890/install-pyside2-on-python-2-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!