I'm trying to install PyQt5 on my Mavericks machine.
I have tried to do it like in this link here Installing PyQt5 with Python 3 On OS X
When I try to install qt5 with brew, there comes a warning:
qt5-5.2.1 already installed
But then when I type python configure.py
Terminal says:
querying qmake about your Qt installation... Error: PyQt5 requires Qt
v5.0 or later. You seem to be using v4.8.6. Use the
--qmake flag to specify the correct version of quake.
Can anyone please help me with this?
When you installed Qt via homebrew, you should have received a warning similar to:
This formula is keg-only, so it was not symlinked into /usr/local.
Qt 5 conflicts Qt 4 (which is currently much more widely used).
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/qt5/lib
CPPFLAGS: -I/usr/local/opt/qt5/include
While this information is very helpful, what you are specifically looking for will be in a directory under /usr/local/opt/qt5/$VERSION_OF_QT/bin/ as qmake is a binary utility.
For me, qmake is located at /usr/local/Cellar/qt5/5.3.1/bin/qmake. Take this path and feed it to your --configure switch and you'll be all set!
e.g. python configure.py --qmake /usr/local/Cellar/qt5/5.3.1/bin/qmake
Related
I'm trying to build the latest release of PySide2 on MacOs Sierra 10.12.2 (16C67) with python 3.6. As of now, the build invoked with
python3 setup.py build
is failing with the following error: (I have substituted my name out of my home directory...)
clang: error: no such file or directory: '/Users/myusername/pythonpackage/pyside-setup/pyside3_build/py3.6-qt5.8.0-64bit-release/pyside2/PySide2/QtCore/PySide2/QtCore/qabstractstate_wrapper.cpp'
I am using Qt 5.8 as installed by homebrew.
I have looked through the build log and cannot find where/if that file is generated, as I am not familiar with the binding generation. Using PyQt is not an option, as its license is not applicable to my application.
Why is this source missing, and what can I do to make the build succeed?
PySide2 was installed from this repo: git://code.qt.io/pyside/pyside-setup.git
Turns out I stated the issue in the actual question: The PySide2 README states that it supports Qt 5.5 and 5.6. I was trying to use 5.8.
I solved my problem by using an old homebrew qt installed via:
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/fdfc724dd532345f5c6cdf47dc43e99654e6a5fd/Formula/qt5.rb
brew install ./qt5.rb
followed by the build invocation, and it worked.
I'm currently in the process of developing a gui for my python script and want to do that by using PySide.
Right now I just can't get it up and running. PIP alwyas exits with this error:
nmake not found. Trying to initialize the MSVC env...
Searching MSVC compiler version 10.0 error: Failed to find the MSVC compiler version 10.0 on your system.
I have the following components installed:
Python 3.4.4 (64Bit)
QT 5.6 / 5.7
Pycharm Community Edition
Windows 7 64Bit
I can run PIP and Python from the terminal without having to cd into the python directory. So my PATH Variables are set correctly.
Does anybody have the same issues or maybe a solution?
Best
Jo
PySide requires Python 2.6 or later and Qt 4.6 or better.
Qt 5.x is currently not supported.
From: https://pypi.python.org/pypi/PySide/1.2.4#installing-pyside-on-a-windows-system
So maybe using qt4.x(>=4.6) instead of qt5.x can fix your problem.
I think the reason is that pip on your system install PySide from source package so you need a c/c++ complier.
Maybe you can install PySide binary version directly following this:
pip install PySide --only-binary :all:
If it doesn't work, please try to download ".exe" file, and run it instead of using pip.
".exe" from: https://download.qt.io/official_releases/pyside/
So after installing the whole 5.5 Qt package, and installing SIP, and the Xcode command line tools, I get this problem when trying to install the PyQt folder i got from the .gz I downloaded from the website
Joshuas-MacBook-Pro-2:PyQt-gpl-5.5 Josh$ python configure.py -q /Users/Josh/Qt/5.5/clang_64/bin -d /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/
Querying qmake about your Qt installation...
sh: /Users/Josh/Qt/5.5/clang_64/bin: is a directory
Error: PyQt5 requires Qt v5.0 or later. You seem to be using v3. Use the
--qmake flag to specify the correct version of qmake.
However, I clearly have v5.5 of Qt.
Any idea how to fix this or type in a different command to install it directly?
After spending much time getting PyQt working smoothly on a Mac, my strong recommendation is to install PyQt via Homebrew. The steps are very simple:
1) Install homebrew from here
2) Edit your ~./bash_profile to include the following at the top, so that later installs will see the brew versions of installs:
export PATH=/usr/local/bin:$PATH
3) Refresh your terminal window:
>source ~/.bash_profile
4) Then, simply install python, sip, pyqt in that order:
>brew install python
>brew install sip
>brew install pyqt
You should now have a fully working python/pyqt environment that you can customize via pip etc.
I'm using OS X Mavericks with system Python 2.7.
I installed PyGObject, GTK+ and glade as I descripted below, but Python doesn't see gtk.glade module.
All libraries from Homebrew:
brew install libglade
brew install gtk+
brew install pygobject
Also, I set PYTHONPATH in .bash_profile to:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
When I run Python and try import pygtk or gtk - all works fine. But when I try to load gtk.glade I get no module error.
So I'll try install pygobject with --verbose mode and I noticed, that installer couldn't find libglade:
checking for LIBGLADE... no
…
The following modules will be built:
atk
pango
pangocairo
gtk with 2.24 API
gtk.unixprint
The following modules will NOT be built:
gtk.glade
I assumed that pygobject installer can't find path to libglade (which is installed to /usr/local/Cellar/libglade/2.6.4).
How and what path should I change? Or what else to do?
Thanks in advance!
I had exactly the same problem and the following DID NOT work:
brew install --verbose --glade pygtk
But the following DID work on Mavericks with Python 2.7:
brew install --verbose --with-libglade pygtk
See also this discussion
PyGObject support for Gtk+2 is rater limited as Gtk+2 wasn't created with full Introspection support.
If you're using PyGobject don't use PyGtk, they are different things. In any case, why you need to use libglade? To support old Software? If that's the case, don't use PyGObject, use whatever version the Software was made with.
If you need to parse Glade files to build a GUI, use Gtk+ included GtkBuilder object, libglade was deprecated long long long long ago.
See gi.repository Windows, in particular differences with Gtk+2 and Gtk+3. Also, see How can a program that uses GUI be constructed? for how to build a Glade GUI using PyGObject, Python2.7 and GtkBuilder (this is what I suppose you need).
Need to include the "--glade" config option to Brew when installing, this causes the recipe/formula to make the bindings.
Need to install 'glade'; this will also install 'libglade'
Then install pygtk with the following option "brew install --glade pygtk"
I would like to install spyder (the math IDE for python, here 2.7) on my windows 8.1 machine.
I did install python starting from http://www.python.org/download/releases/2.7.6/;
I did install pip after having installed setuptools, following http://www.pip-installer.org/en/latest/installing.html for these installations;
I did change my path to add C:\Python27 and C:\Python27\Scripts to it, digging into the advanced parameters of my PC's properties. (By the way, I can't beleive the way you do this on windows has not changed for ages, with such a small input where you forgot to go at the end of the value when adding your path...)
I did install spyder
pip install spyder
But when launching it in command line (it's in the path :-) ), I ran through this error:
RuntimeError: Please check Spyder installation requirements:
PyQt4 4.4+ (or PySide 1.1.1+) is required.
Which is truly true. Though,
when trying to pip PyQt4 :
No distributions at all found for PyQt4
when trying to pip PySide, I have many errors, the root one seeming that it is unable to find nmake
Any piece of advice ?
To install PySide on Windows you can choose from the following options:
Download and install the packages from the releases page.
Use setuptools to install the egg binary packages:
c:> c:\Python27\Scripts\easy_install PySide
Use pip to install the wheel binary packages:
c:> c:\Python27\Scripts\pip install --use-wheel PySide
Details are here https://pypi.python.org/pypi/PySide#installing-pyside-on-a-windows-system
BTW: PyQt does not support setuptools or pip
I am not sure if its a proper answer, but you might want to take a look at PythonXY. It makes all these installation procedure a breeze.
From the details in your question, it looks like you are missing both PyQt4 and Qt itself.
There are binary installers for Windows available from the PyQt download page. These installers include both PyQt and Qt (as well as various other tools such as Qt Designer). The only things not included are the Qt documentation, and Python itself (which you seem to have already installed).
Just be careful to select the right installer from the list of Binary Packages: i.e. the one for Python-2.7, plus whatever architecture is appropriate for your system.