Как установить PyQT4 и каковы практические различия между PyQT4 и PyQT5?

21965
amn

Я собираюсь начать разработку с использованием PyQT, но, похоже, существует две версии. На какую мне пойти?

Кроме того, я не могу быть в состоянии установить либо с помощью pip install PyQt4я получаю следующее сообщение об ошибке:

Downloading/unpacking PyQt4 Could not find any downloads that satisfy the requirement PyQt4 Cleaning up... No distributions at all found for PyQt4 Storing complete log in /home/user/.pip/pip.log 

Журнал говорит:

Exception information: Traceback (most recent call last): File "/home/user/projects/pyqt-test-1/lib/python2.7/site-packages/pip/basecommand.py", line 134, in main status = self.run(options, args) File "/home/user/projects/pyqt-test-1/lib/python2.7/site-packages/pip/commands/install.py", line 236, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/home/user/projects/pyqt-test-1/lib/python2.7/site-packages/pip/req.py", line 1085, in prepare_files url = finder.find_requirement(req_to_install, upgrade=self.upgrade) File "/home/user/projects/pyqt-test-1/lib/python2.7/site-packages/pip/index.py", line 265, in find_requirement raise DistributionNotFound('No distributions at all found for %s' % req) DistributionNotFound: No distributions at all found for pyqt4 

pip search pyqtсписки, по крайней мере, PyQt4так что у меня создается впечатление, что пакет находится в списке:

PyQt4 - Python bindings for the Qt cross platform GUI toolkit 

Есть ли какой-нибудь официальный способ установить эту штуку на общий Linux? Как я могу это сделать?

6

3 ответа на вопрос

14
Jon

I emailed rivercomputing:

If I try to installed PyQt4 via pip, I get the following message:

$ pip install PyQt4 Downloading/unpacking PyQt4 Could not find any downloads that satisfy the requirement PyQt4 No distributions at all found for PyQt4 Storing complete log in /home/jon/.pip/pip.log

However, if I search for PyQt4, the package is clearly there:

$ pip search PyQt4 ... ... PyQt4 - Python bindings for the Qt cross platform GUI toolkit python-qt - Python compatibility wrapper for Qt Bindings ... ...

The pypi page for this package is also reachable (https://pypi.python.org/pypi/PyQt4/4.10.3); however, I did notice that the download statistics are at 0.

How can I install PyQt4 via pip?

And got the following "not constructive" reply:

You can't.

4
dragfire

Я думаю, чтобы установить PyQt4, в первую очередь вам нужно sip . Информация может быть доступна на веб-сайте River Bank .

или если вы используете Ubuntu / debian, вы можете легко получить из репозиториев:

sudo apt-get установить pyqt4-dev-tools

0
Rest

Я столкнулся с той же проблемой. В конце концов, я скачал SIP и PyQt от riverbankcomputing.com, и установил их:

python configure.py make make install 
Я не понимаю, как это отвечает на вопрос. David Richerby 8 лет назад 0