Installing PyQt on Windows

1,837 views
Skip to first unread message

Largo84

unread,
Mar 27, 2017, 11:06:25 AM3/27/17
to leo-editor
I am trying to set up Leo for a colleague on his Windows PC and see that it's much more difficult than I recall, especially for non-programmers. Apparently, PyQt no longer provides Windows binary installation executables. Not really knowing what else to try, I opened the Python command shell and typed `pip3 install PyQt5` and got a syntax error.

Sorry if the answer is obvious or easy, but for me it's neither. Any help or suggestions appreciated.

Rob.....

lewis

unread,
Mar 27, 2017, 4:43:11 PM3/27/17
to leo-editor
Open console or use windows cmd.exe

Locate your python3 folder and cd to /lib/site-packages

Type pip3 install PyQt5

Pip will proceed to download and install and you should be set.
Regards
Lewis

lewis

unread,
Mar 27, 2017, 5:09:42 PM3/27/17
to leo-editor
If it were your PC and you had Python3.6 installed using defaults, then cd to your user home to find the Python 3 installation.
C:\Users\Largo84\AppData\Local\Programs\Python\Python36\Lib\site-packages>

If you haven't installed Docutils yet you can also use pip to install:
...\AppData\Local\Programs\Python\Python36\Lib\site-packages> pip install docutils

Regards
Lewis

Largo84

unread,
Mar 27, 2017, 5:40:46 PM3/27/17
to leo-editor
Will have to wait a few days to try again, but thanks for the suggestion. Better documentation on this process would be helpful at the PyQt site. Simply to suggest running `pip3 install PyQt` without directing from where is not helpful at all.

Rob.....

Edward K. Ream

unread,
Mar 27, 2017, 6:05:41 PM3/27/17
to leo-editor
On Mon, Mar 27, 2017 at 10:06 AM, Largo84 <lar...@gmail.com> wrote:
I am trying to set up Leo for a colleague on his Windows PC and see that it's much more difficult than I recall, especially for non-programmers. Apparently, PyQt no longer provides Windows binary installation executables. Not really knowing what else to try, I opened the Python command shell and typed `pip3 install PyQt5` and got a syntax error.

​PyQt5 seems to be a moving target.  It's possible to screw up a previously working Qt5 installation, as I demonstrated several times today.

My suggestion is to start with a Python 3 version of Anaconda.  I also recommend installing 32-bit versions, even on 64-bit systems.  That way you can install ​
 
​pyenchant.

I have been successful in installing 4.1.1 on both Python 2 and 3. The installers are:

- Anaconda2-4.1.1-Windows-x86.exe and​
- Anaconda3-4.1.1-Windows-x86.exe

According to my notes, Anaconda 4.2 was buggy: it does not handle QTreeWidget properly.  This was several months ago.  Perhaps things are better now.

Once you get Anaconda installed and working, you should be able to use conda install. If you have multiple Anaconda installations, you will need to use the proper conda script, in either Anaconda2/scripts or Anaconda3/scripts.

Sorry if the answer is obvious or easy, but for me it's neither. Any help or suggestions appreciated.

​Clearly, installing both python and pyqt (and especially pyqt5) is made more difficult by qt bugs. But in the long run, I think using Anaconda is the best bet.

Having said that, Lewis's suggestions might be enough. 

Edward

Largo84

unread,
Mar 27, 2017, 7:49:32 PM3/27/17
to leo-editor
Thanks for that, Edward. I looked at Anaconda a few days ago, but found it a little overwhelming. Maybe it will be easier than I think once I get started. I'd like to revert one of my Win10 machines to 32 bit version so I can install pyenchant. Would it be best to uninstall everything and start over from scratch with Anaconda? Leo works fine on that machine now (except for no spell check).

Rob....

Offray Vladimir Luna Cárdenas

unread,
Mar 27, 2017, 11:58:05 PM3/27/17
to leo-e...@googlegroups.com

Hi,

I think that Anaconda is maybe too much, but I would advice to checkout miniconda, which is basically just the installer and the python interpreter and serves the same purpose, without including a scientific python distribution with jupyter, to install Leo. My advice is to create a Leo installer/updater using miniconda as a base. Same installation recipes should work on miniconda and anaconda.

Cheers,

Offray

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Jacob MacDonald

unread,
Mar 28, 2017, 12:11:46 AM3/28/17
to leo-e...@googlegroups.com
I have Leo running in a Miniconda environment. It's not on Windows, but I could provide my environment configuration if it would be helpful. From that, it is one command to create a working environment with the conda command line tool.

Regards,

Jacob.

Edward K. Ream

unread,
Mar 28, 2017, 4:22:08 AM3/28/17
to leo-editor
On Mon, Mar 27, 2017 at 6:49 PM, Largo84 <lar...@gmail.com> wrote:

Would it be best to uninstall everything and start over from scratch with Anaconda?

​You shouldn't have to do that.  I have both Anaconda 2 and 3 installed, in c:\Anaconda2 and c:\Anaconda3.  I have scripts that choose between them: python2, python3, pip2, pip3, leo2, leo3 etc.

In this way you could even have other python distros, including IPython.y

Edward​

Offray Vladimir Luna Cárdenas

unread,
Mar 28, 2017, 11:59:09 AM3/28/17
to leo-e...@googlegroups.com

Yes Jacob, please provide us your environment configuration. I'm entering to a couple of really busy moths (last part of writing my thesis), but I can try to test your setup in miniconda and give feedback.

Cheers,

Offray

Jacob MacDonald

unread,
Mar 28, 2017, 6:39:42 PM3/28/17
to leo-e...@googlegroups.com
name: leo
channels:
- defaults
dependencies:
- alabaster=0.7.10=py36_0
- babel=2.3.4=py36_0
- dbus=1.10.10=0
- docutils=0.13.1=py36_0
- expat=2.1.0=0
- fontconfig=2.12.1=3
- freetype=2.5.5=2
- glib=2.50.2=1
- gst-plugins-base=1.8.0=0
- gstreamer=1.8.0=0
- icu=54.1=0
- imagesize=0.7.1=py36_0
- jinja2=2.9.5=py36_0
- jpeg=9b=0
- libffi=3.2.1=1
- libgcc=5.2.0=0
- libiconv=1.14=0
- libpng=1.6.27=0
- libxcb=1.12=1
- libxml2=2.9.4=0
- markupsafe=0.23=py36_2
- openssl=1.0.2k=1
- pcre=8.39=1
- pip=9.0.1=py36_1
- pygments=2.2.0=py36_0
- pyqt=5.6.0=py36_2
- python=3.6.1=0
- pytz=2016.10=py36_0
- qt=5.6.2=3
- readline=6.2=2
- requests=2.13.0=py36_0
- setuptools=27.2.0=py36_0
- sip=4.18=py36_0
- six=1.10.0=py36_0
- snowballstemmer=1.2.1=py36_0
- sphinx=1.5.1=py36_0
- sqlite=3.13.0=0
- tk=8.5.18=0
- wheel=0.29.0=py36_0
- xz=5.2.2=1
- zlib=1.2.8=3

Jacob MacDonald

unread,
Mar 28, 2017, 6:42:05 PM3/28/17
to leo-editor
Run by cloning the Leo repository, activating the environment created using that file, and 

python launchLeo.py

should send you on your way!
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.

To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.

To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.

To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscribe@googlegroups.com.

Jacob MacDonald

unread,
Mar 29, 2017, 8:31:35 PM3/29/17
to leo-editor
All right, did a small amount of testing on Windows, and that environment list won't work. Turns out it is platform-specific. In general though, pyqt installs through Miniconda just fine. Tweaking the list of dependency and getting vs_xx versions is necessary on Windows. Also, if you want spell checking you will need a 32 bit environment to install the pyenchant wheel into. You can do that using the CONDA_FORCE_32BIT environment variable. It's undocumented but documented in a GitHub issue.
Reply all
Reply to author
Forward
0 new messages