问题
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