Uninstalling PyQt5 to install PyQt4 - windows

I use Windows 7 and Python 3.4 (32bit). I installed PyQt5 and proceeded watching tutorials on how to use the module. However, the tutorial used PyQt4 instead and I faced problems. So, I decided to switch from PyQt5 to the older, PyQt4. I installed PyQt5 using the Windows Installers.
When I proceeded to install PyQt4, it gives me this error message: A copy of PyQt5 for Python v3.4 is installed in C:\Python34 and must be uninstalled first.
After checking the documentation, it said that we couldn't have both PyQt4 and PyQt5 installed at the same time, unless we built from source. I'm not sure how to build from source on Windows but after trying(extracting sip, running configure.py; extracting PyQt4, running configure-ng.py/configure.py) I still get a bunch of errors namely:
something Qmake related
Import Error: No module named sipconfig.
I gave up trying to build from source and instead just wanted to uninstall PyQt5 so I could use PyQt4. I deleted the sip folder and PyQt4 from the botched installation first. Then, I deleted PyQt5 itself from site-packages as well as qt.conf in C:\Python34.
Running the binaries for PyQt4 still gives me the PyQt5 is installed error message. How do I uninstall PyQt5 completely so that I can install PyQt4? Thanks.

I installed PyQt5 again using the installer and the used the uninstall.exe provided in the PyQt5 folder in site-packages. I hope this solution is helpful for others such as those here.
Uninstall using uninstall.exe which is provided in your PyQt4/5 folder in site-packages. If you already deleted the folder, just reinstall it with the .exe you first used and try again.

Try:
pip3 uninstall pyqt5
It worked seamlessly for me.

Related

How to install PyGObject in Anaconda under Windows 10?

I tried to run this simple code, which is about GUI programming in python usinh Python GTK+ 3:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
I have anaconda 5.2 installed with Python 3.6 under Windows 10, and I get this error:
import gi
ImportError: No module named 'gi'
Even if I install anaconda 4.2 with Python 3.5 I get the same error.
I could not figure out how to install gi, which is apparently part of PyGObject.
using pip install PyGObject results in an error:
Failed building wheel for PyGObject
Can anybody help?
As I explain in this answer there are two ways (afaik) to install PyGObject in Windows.
If you use the .exe installer you'll be restricted to Python 3.4. I've never used it with Anaconda, but the installer (before automatically checking for Python interpreter installations) lets you select "portable" installations of the interpreter (I believe this might be the way to point to a virtual environment interpreter, maybe a conda installed interpreter, I've never used it though). You can try and let it try to find your interpreter automatically and if it doesn't then you can cancel the install and re try with the "portable" approach.
If you use MSYS2 I really don't know how you can make it work. You'll have to use the included pacman instead of Anaconda to manage your packages, so I don't know if this is what you want.

Installing PyQt5 Designer on windows

I installed PyQt5 using Windows command window and pip3 install PyQt5 as described in the download page, it was installed successfully. but I didn't found PyQt Designer in the Windows Start Menu so I thought I need to install it separately. After searching various forums, I tried adding it using pip3 install pyqt5-tools it shows Successfully installed pyqt5-tools-5.9.0.1.2 but PyQt Designer wasn't installed.
Is there any way to install PyQt Designer?
My Python version:
>>> python --version
Python 3.5.2 :: Anaconda custom (64-bit)
On windows 10, with Python3.5, and pyqt5, I installed pyqt5-tools using pip:
pip install pyqt5-tools
and the designer was automatically install in the following folder:
"Python directory"\Python35\Lib\site-packages\pyqt5-tools
try this:
pip install pyqt5
pip install pyqt5-tools
Now you'd find the designer in site-packages/pyqt5-tools.
Lib\site-packages\qt5_applications\Qt\bin
I think I found a workaround, first I uninstalled PyQt5 and pyqt5-tools-5.9.0.1.2
pip3 uninstall PyQt5
pip3 uninstall pyqt5-tools-5.9.0.1.2
I went to this page, downloaded the PyQt5-5.6-gpl-Py3.5-Qt5.6.0-x64-2.exe file and installed it normally.
In most cases, due to updates of the packages or some other reasons, "designer tool" will not be in the default location.
If so, you can find it here:
C:\Program Files (x86)\Python37-32\Lib\site-packages\pyqt5_tools\Qt\bin
try
pip install PyQt5Designer It will then be under lib/QtDesigner/designer.exe
this is might be not much helpful but i just wanted to share, I install pyqt5 using pip with the tools as well and couldn't find PyQt Designer in the Windows Start as well coz I searched "pyqt designer". I could find it when i searched "designer" only.
pip install pyqt5-tools
....\venv\Lib\site-packages\qt5_applications\Qt\bin

Installing Wxpython on mac

I am trying to install wxpython on mac os. I have already tried following solution. I have already enables software installation from all sources
a) Downloaded the binary for mac and tried to install it. It says no software found to install at the last step.
b) I tried using brew to install. The brew command works find but when when I tried import wx it says no module found.
Can you specify how to get rid of this error? My mac version is 10.11.5 I am using python 2.7
Try using the installer found here: https://wxpython.org/snapshots/. It is a current (as of 2 weeks ago) snapshot of the code, modified to use the newer Installer Package format.

git-cola will not run on windows

I have installed git-cola using the setup installer for windows. I pointed it to proper installs of git and python.
When I try to launch git-cola, nothing happens whatsoever.
Is there something I am missing here?
I had the same problem, in my case it was missing PyQt4 library. You can install PyQt4 by downloading an appropriate installer from Binary Packages section on PyQt4 Riverbank website.
How I investigated the issue
When I installed git-cola in a default directory and tried to run it using a command line
C:\Program Files (x86)\git-cola\bin>python git-cola.pyw
I got
Sorry, you do not seem to have PyQt4 installed.
Please install it before using git-cola.
e.g.: sudo apt-get install python-qt4
Note
I have two Python 2.7 installations, one at c:\program\Python27 and another at C:\Users\UserName\Anaconda2, I used the first one. I also installed Python SIP some time ago, I'm not sure if it required by git-cola.

Install wxpython on mac

I am new to Mac, have always used windows and I am confused on how to install wxPython. I downloaded the .dmg file from the website, and it contained three files:
a pkg file, a readme, and an uninstall.py
I opened the pkg file, went through the steps, and Im not sure where it installed after it said "Installation Complete"
Also, I did the import wx in idle, which caused a stacktrace error.
Thanks.
From personal experience on installing wxPython on both Windows 7 and Mac OSX, I found restarting the computer helps out after installation and stacktrace errors appearing in the Shell upon 'import wx'. Sounds simple enough, but it worked for me. If no errors appear after 'import wx', that means wxPython installed correctly. To add to bouke's answer above, the current way to install Python 2.7 via homebrew in Terminal:
brew install python
To install wxPython:
brew install wxpython
At least for development, I would suggest to install (python and) wx using homebrew. It will install version 2.9 and you're ensured that Apple-provided system libraries remain untouched.

Resources