From fellow classmates I have been asked to show how to install PyQT5 on a Windows 10 system for use in Python 3 in our programming classes. Coming from Linux I initially just said "Well, install it" but it turns out to be a little more involved than that. The PyQT homepage, seems to no longer have Windows binaries available for download, there are other sources, but I wanted to find something that was as reliable as installing the package on a Linux system.

There are probably easier ways of achieving this, but this is the method I settled on:

Find your Python 3 directory

Python will install itself under your user directory. My Windows user name is olebole, and Python 3.6 is at:

C:\Users\olebole\AppData\Local\Programs\Python\Python36

When using the Windows Explorer you will have to enable showing hidden folders and files to see the AppData folder in your home directory.

You need to find your Python location since this is where pip is installed. Pip is used to install packages from PyPI - the Python Package Index.

Install PyQT5

Now that you have your Python installation path, proceed to start a command shell (Win+R, cmd, Enter) and change into the Scripts directory in the Python installation directory and use pip.exe to install PyQT5.

cd c:\Users\oblivion\AppData\Local\Programs\Python\Python36\Scripts

pip install PyQT5

Setting the PATH

If you expect on doing this a lot it would be a good idea to add the path of pip.exe to the PATH environment variable. I leave this as an exercise to the reader, while I hurry back to my trusted terminal window.

Since I first learned of rsync, copying files have not been the same. If you do not know rsync, you should read up on it now.

Though I like rsync I have always been a little bothered that there was seemingly no way of forcing rsync to count the total number of files before transferring them, thus making the --progress option partially useless. This time I did some research, and found that if your rsync is newer than version 3.1.0 there is an --info option.

From the rsync manual page:

--info=FLAGS
This option lets you have fine-grained control over the information output you want to see. An individual flag name may be followed by a level number, with 0 meaning to silence that output, 1 being the default output level, and higher numbers increasing the output of that flag (for those that support higher levels). Use --info=help to see all the available flag names, what they output, and what flag names are added for each increase in the verbose level. Some examples:

    rsync -a --info=progress2 src/ dest/
    rsync -avv --info=stats2,misc1,flist0 src/ dest/

Note that --info=name's output is affected by the --out-format and --itemize-changes (-i) options. See those options for more information on what is output and when.

This option was added to 3.1.0, so an older rsync on the server side might reject your attempts at fine-grained control (if one or more flags needed to be send to the server and the server was too old to understand them). See also the "max verbosity" caveat above when dealing with a daemon.

With the --info=progress2 i get the following kind of output:

receiving incremental file list
            0   0%    0.00kB/s    0:00:00 (xfr#0, ir-chk=1001/71529)
Documents/development/projects/C/linux/cdcat/src/gcdCat/src/.deps/
            0   0%    0.00kB/s    0:00:00 (xfr#0, ir-chk=1000/71612)
Documents/development/projects/C/linux/cdcat/src/gcdCat/src/CVS/
            0   0%    0.00kB/s    0:00:00 (xfr#0, ir-chk=1000/73443)
Documents/ebooks/Humble bundle/
            0   0%    0.00kB/s    0:00:00 (xfr#0, ir-chk=1014/73485)

Which seem what I have wished for.

I will walk through copying a bootable Windows 7 installation from a VirtualBox VM to real iron.

  • Insert an external hard drive in the USB port and share it with your Windows 7 VM.
  • Ask windows to make a system image "Control Panel -> Back up your computer -> Create system image", and save it to the external hard drive.
  • Boot the Windows 7 install disk, click through, and select "Repair windows installation". The drives that you do not put on the exclude list, will be repartitioned and formatted, so make sure to exclude everything you want to keep.
  • Let it chew on your backup, and when done, boot Windows.

Generated on 2017-03-19 22:52:04.575435