- Установка PIP для Python и базовые команды
- Что такое PIP для Python?
- Устанавливается ли PIP вместе с Python?
- Правильно ли Python установлен?
- Как установить PIP на Windows.
- Как установить PIP на Mac
- Как установить PIP на Linux
- Как установить PIP на Raspberry Pi
- Как обновить PIP для Python
- Как устанавливать библиотеки Python с помощью PIP
- How to install pyqt4 on ubuntu linux
- Related posts
- Comments
- Install pyqt
- How to install PyQt5 on Windows?
- How to install PyQt5 on Mac OS X?
- How to install PyQt5 on Linux?
- Linux Mint Forums
- [Solved] PyQt4 dosent install with PIP
- [Solved] PyQt4 dosent install with PIP
- Re: PyQt4 dosent install with PIP
- Re: [Solved] PyQt4 dosent install with PIP
- Re: [Solved] PyQt4 dosent install with PIP
- Re: [Solved] PyQt4 dosent install with PIP
Установка PIP для Python и базовые команды
Как любой серьёзный язык программирования, Python поддерживает сторонние библиотеки и фреймворки. Их устанавливают, чтобы не изобретать колесо в каждом новом проекте. Необходимы пакеты можно найти в центральном репозитории Python — PyPI (Python Package Index — каталог пакетов Python).
Однако скачивание, установка и работа с этими пакетами вручную утомительны и занимают много времени. Именно поэтому многие разработчики полагаются на специальный инструмент PIP для Python, который всё делает гораздо быстрее и проще.
Что такое PIP для Python?
Сама аббревиатура — рекурсивный акроним, который на русском звучит как “PIP установщик пакетов” или “Предпочитаемый установщик программ”. Это утилита командной строки, которая позволяет устанавливать, переустанавливать и деинсталлировать PyPI пакеты простой командой pip .
Если вы когда-нибудь работали с командной строкой Windows и с терминалом на Linux или Mac и чувствуете себя уверенно, можете пропустить инструкции по установке.
Устанавливается ли PIP вместе с Python?
Если вы пользуетесь Python 2.7.9 (и выше) или Python 3.4 (и выше), PIP устанавливается вместе с Python по умолчанию. Если же у вас более старая версия Python, то сначала ознакомьтесь с инструкцией по установке.
Правильно ли Python установлен?
Вы должны быть уверены, что Python должным образом установлен на вашей системе. На Windows откройте командную строку с помощью комбинации Win+X . На Mac запустите терминал с помощью Command+пробел , а на Linux – комбинацией Ctrl+Alt+T или как-то иначе именно для вашего дистрибутива.
Затем введите команду:
На Linux пользователям Python 3.x следует ввести:
Если вы получили номер версии (например, Python 2.7.5 ), значит Python готов к использованию.
Если вы получили сообщение Python is not defined (Python не установлен), значит, для начала вам следует установить Python. Это уже не по теме статьи. Подробные инструкции по установке Python читайте в теме: Скачать и установить Python.
Как установить PIP на Windows.
Следующие инструкции подойдут для Windows 7, Windows 8.1 и Windows 10.
- Скачайте установочный скрипт get-pip.py. Если у вас Python 3.2, версия get-pip.py должны быть такой же. В любом случае щелкайте правой кнопкой мыши на ссылке и нажмите “Сохранить как…” и сохраните скрипт в любую безопасную папку, например в “Загрузки”.
- Откройте командную строку и перейдите к каталогу с файлом get-pip.py.
- Запустите следующую команду: python get-pip.py
Как установить PIP на Mac
Современные версии Mac идут с установленными Python и PIP. Так или иначе версия Python устаревает, а это не лучший вариант для серьёзного разработчика. Так что рекомендуется установить актуальные версии Python и PIP.
Если вы хотите использовать родную систему Python, но у вас нет доступного PIP, его можно установить следующей командой через терминал:
Если вы предпочитаете более свежие версии Python, используйте Homebrew. Следующие инструкции предполагают, что Homebrew уже установлен и готов к работе.
Установка Python с помощью Homebrew производится посредством одной команды:
Будет установлена последняя версия Python, в которую может входить PIP. Если после успешной установки пакет недоступен, необходимо выполнить перелинковку Python следующей командой:
Как установить PIP на Linux
Если у вас дистрибутив Linux с уже установленным на нем Python, то скорее всего возможно установить PIP, используя системный пакетный менеджер. Это более удачный способ, потому что системные версии Python не слишком хорошо работают со скриптом get-pip.py, используемым в Windows и Mac.
Advanced Package Tool (Python 2.x)
Advanced Package Tool (Python 3.x)
pacman Package Manager (Python 2.x)
pacman Package Manager (Python 3.x)
Yum Package Manager (Python 2.x)
Yum Package Manager (Python 3.x)
Dandified Yum (Python 2.x)
Dandified Yum (Python 3.x)
Zypper Package Manager (Python 2.x)
Zypper Package Manager (Python 3.x)
Как установить PIP на Raspberry Pi
Как пользователь Raspberry, возможно, вы запускали Rapsbian до того, как появилась официальная и поддерживаемая версия системы. Можно установить другую систему, например, Ubuntu, но в этом случае вам придётся воспользоваться инструкциями по Linux.
Начиная с Rapsbian Jessie, PIP установлен по умолчанию. Это одна из серьёзных причин, чтобы обновиться до Rapsbian Jessie вместо использования Rapsbian Wheezy или Rapsbian Jessie Lite. Так или иначе, на старую версию, все равно можно установить PIP.
На Rapsbian для Python 2.x следует пользоваться командой pip, а для Python 3.x — командой pip3 при использовании команд для PIP.
Как обновить PIP для Python
Пока PIP не слишком часто обновляется самостоятельно, очень важно постоянно иметь свежую версию. Это может иметь значение при исправлении багов, совместимости и дыр в защите.
К счастью, обновление PIP проходит просто и быстро.
Для Mac, Linux, или Raspberry Pi:
На текущих версиях Linux и Rapsbian Pi следует использовать команду pip3.
Как устанавливать библиотеки Python с помощью PIP
Если PIP работоспособен, можно начинать устанавливать пакеты из PyPI:
Установка определённой версии вместо новейшей версии пакета:
Поиск конкретного пакета:
Просмотр деталей об установленном пакете:
Список всех установленных пакетов:
Список всех устаревших пакетов:
Обновление устаревших пакетов:
Следует отметить, что старая версия пакета автоматически удаляется при обновлении до новой версии.
Источник
How to install pyqt4 on ubuntu linux
Install and run «hello world» example
Install additional examples
- For more examples, install the python-qt4-doc package:
- After installation, the examples are located at:
Related posts
- PyQt: How to pass arguments while emitting a signal— posted 2008-01-29
- PyQt4 QItemDelegate example with QListView and QAbstractListModel— posted 2008-01-23
- Python PyQt Tab Completion example— posted 2008-01-04
- How to capture the Tab key press event with PyQt 4.3— posted 2008-01-03
- PyQt 4.3 Simple QAbstractListModel/ QlistView example— posted 2008-01-03
Comments
And then. i do that but it doesn’t work. 🙁 what can i do?
pamchi,
I’ve update the post to include some more information. Good luck!
#3 B commented on 2008-10-02 :
it’s somewhat odd, but it seems like the python-qt4 package is missing some parts. specifically, I’ve run into two so far: setTimeSpec from QDateTimeEdit and setHeaderHidden from QTreeView. Both of these are in the docs, so I guess to use them you need to do a manual install? Unless the next release fixes this.
B, the python-qt4 package in Ubuntu Hardy provides PyQt 4.3. However, currently, the latest version is PyQt 4.4. You were probably looking at the docs for 4.4. To get the latest version, you can install it manually (I don’t think it is very hard). Or, if you can wait a month, Ubuntu Intrepid will include PyQt 4.4.
#5 Robert commented on 2008-10-05 :
I’m trying to get Thin Liquid Film running on my Intrepid Ibex installation. However, when I try installing it, it tells me that I’m missing pyqt.
I loaded Synaptic and have installed the python-qt4 package (version 4.4.3-1ubuntu1) which includes the libqtcore package version 4.4.3-0ubuntu1 and python-bindings version 4.4.3-1ubuntu1.
Any ideas why its not installing?
#6 Robert commented on 2008-10-05 :
Answering my own question. Apparently TLF is specifically looking for QT3. Guess they haven’t updated their program as of yet.
#7 trish commented on 2010-01-02 :
It worked fine for me. Great example of a small qt program. i am impressed.
#8 Pradeep commented on 2010-08-03 :
Hii I am have suffering few problems in doing following assignment , please help me.
Qtprogram using python to calculate addition, subtraction.
please help me . i am new in python
Thank you, your post, saved me some time. 🙂
#10 Anwar Ahmed commented on 2011-01-22 :
thanks , it was quick to find and simple.
#11 Umid commented on 2011-02-04 :
On my ubuntu box, there are python2.6 and python3.1
When I installed PyQt4 it works for python2.6.
How to configure it for python3.1 too?
#12 yanghaipo commented on 2011-02-23 :
Thanks, this is really a good example.
#13 AA commented on 2011-09-25 :
After trying, the follow appears:
Depende: libqt4-designer (>= 4:4.7.0) mas não vai ser instalado Depende: libqt4-help (>= 4:4.7.0) mas não vai ser instalado Depende: libqt4-scripttools (>= 4:4.7.0) mas não vai ser instalado Depende: libqt4-test (>= 4:4.7.0) mas não vai ser instalado Depende: libqtassistantclient4 (>= 4.6.3) mas não vai ser instalado Depende: sip-api-8.1
After trying to install libqt4 it appears:
Depende: python-qt4 (>= 4.4) mas não vai ser instalado Depende: python-sqlalchemy (>= 0.4.3) mas não vai ser instalado Depende: python-beautifulsoup mas não vai ser instalado Recomenda: python-matplotlib mas não vai ser instalado
So, basically, one depends on the other, and none will install.
Thank you for the tips though.
#14 George Van Tuyl commented on 2012-01-08 :
Worked just fine thank you. Ubuntu 11.1 Wheezy/sid 3.0.0-14-generic-pae i686
#15 Juuso commented on 2012-01-26 :
If you are looking for pyqt designer, you should also add: apt-get install libqt4-dev qt4-dev-tools python-qt4-dev pyqt4-dev-tools
#16 ken brockman commented on 2012-02-28 :
I have been trying unsuccessfully on and off for over three months to get eric5 installed on my Ubuntu 11.10 system. Each time I try to compile it, i get the same error msg, «Qthelp not found». I have python2.7 and 3.2 and 3.2mu installed. When i install I have referenced python, python3.2 and python3.2mu, all to no avail. Any help would be greatly appreciated. Tkinter is looking better by the day, though I would really love to use QT and eric5. If I try using apt-get install, it says already installed because they are, for 2.7, but not 3.2. I have BUILT MAKE INSTALLED the QT downloads several times along with SIP, Pyqt, pyside and several other apps, but once again,, nada. I am starting to think it can’t be done. in all of my 30 plus years of using building and repairing computers, I have never, ever seen anything as convoluted and aggravating as this. For the love of God if anyone, anywhere has any idea of how to get this %^$&$ thing to work, PLEASE,, let me know.
#17 Anthony Scaife commented on 2012-06-08 :
Quick and easy advice, thanks. Worked first time for me. Ubuntu 10.04.
#18 Ha Thanh commented on 2012-09-09 :
Yes, it worked for me. Ubuntu 11.10.
#19 paython commented on 2012-09-21 :
We do not need to install sip before install pyqt?
#20 Diego commented on 2012-11-10 :
Thanks for this help.
#21 chm commented on 2012-12-21 :
In the latest version of PyQt,The code above should be changed,or we will get «NameError: global name ‘argv’ is not defined «
google is great and your blog is even greater
Why there is no relation between the app and the button? should be only one app in the code? what does it represent?
Источник
Install pyqt
PyQt is often not installed by default. The PyQt module can be used to create desktop applications with Python. In this article you’ll learn how to install the PyQt module.
Desktop applications made with PyQt are cross platform, they will work on Microsoft Windows, Apple Mac OS X and Linux computers (including Raspberry Pi).
How to install PyQt5 on Windows?
To install PyQt on Windows there are a few steps you need to take.
First use the installer from the qt-project website, from qt to install PyQt.
Next you want to install a Python version 3.3 or newer. Check the box to add all of the PyQt5 extras. It’s not necessary to compile everything from source, you can install all the required packages with the installer.
On Python >= 3.6, you can also try this command:
It should work without problems.
How to install PyQt5 on Mac OS X?
On Apple Mac OS X installation is a bit simpler. The first step to take is to install the Mac OS X binary. This installs the PyQt GUI library.
But to use it from Python, you also need Python module. This is where the tool brew comes in.
You can use brew to install pyqt (in the terminal):
How to install PyQt5 on Linux?
Python is often installed by default on Linux (in nearly all of the distributions including Ubuntu). But you want to make sure to use Python 3, because of all the features and ease of use. You can verify that you have the newest Python version with the command:
On Ubuntu Linux they sometimes include two versions of python, python3 and python . In that case use Python 3.
Once you have Python ready, the next step is to install PyQt.
This isn’t hard to do if you have some Linux experience. You can install PyQt your software package manager. Which package manager to use depends on which Linux distribution you are using.
On Ubuntu Linux / Debian Linux you can use the command:
Источник
Linux Mint Forums
Welcome to the Linux Mint forums!
[Solved] PyQt4 dosent install with PIP
[Solved] PyQt4 dosent install with PIP
Post by Karakoram » Thu Jan 05, 2017 7:51 pm
I use PyCharm and i try to install PyQt4 with pip.
I use this command in the terminal : « pip3 install —user PyQt4 »
I got this message: « Could not find a version that satisfies the requirement PyQt4 (from versions: )
No matching distribution found for PyQt4 »
It look strange, maybe something is not compatible with Debian ?
Re: PyQt4 dosent install with PIP
Post by killer de bug » Fri Jan 06, 2017 9:51 am
Best is to use apt to install Python libraries/packages.
I would start with: apt install python3-pyqt4
Re: [Solved] PyQt4 dosent install with PIP
Post by Karakoram » Fri Jan 06, 2017 3:02 pm
Now it’s working.
But i don’t understand what i do. When i do in the terminal « pip3 list » i cant see PyQt4 ans SIS. But in my code editor i can import PyQt4.
What is the difference between pip and apt ?
Re: [Solved] PyQt4 dosent install with PIP
Post by killer de bug » Fri Jan 06, 2017 5:16 pm
Re: [Solved] PyQt4 dosent install with PIP
Post by Karakoram » Fri Jan 06, 2017 5:25 pm
Well Linux is a nice adventure.
I do my first hello world with Qt and i am very happy of what i saw.
Источник