Installing PySide - Windows 8

2019-08-29 06:08发布

问题:

Following these instructions:

http://qt-project.org/wiki/Setting_up_PySide

Successfully installed these programs:

  • PySide-1.1.2.win-amd64-py2.7.exe -
  • qt-win-opensource-4.8.4-vs2010.exe - Qt libraries 4.8.4 for Windows (VS 2010, 234 MB)

Tried the following and got an error:

PS C:\Windows\system32> python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySide
>>> print(PySide.QtCore.__version__)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'QtCore'

I am running windows 8 (64 bit). I ran the commands above from powershell as Administrator.

回答1:

PySide is available on pip now, you can simply install it by using pip command

pip install PySide

Python Installer after 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip (pip3 for Python 3) by default. But remember to add it to the 'PATH' environment variable before you run it in a command line window (Windows+R).Python Install

C:\Python27\;C:\Python27\Scripts\