Monday, April 6, 2015

..and some more...

Windows #1

Not having enough pending and open problems, I fired up my Win7 box and prepared to install Python on it, the first of many steps needed (Python, then Qt, then Sip, then PyQt5, and hunspell and natsort and sortedcontainers. And Wing IDE at some point.) And of course step 1 didn't complete.

"There is a problem with this Windows Installer package" and "Python 3.4.3(64-bit) setup ended prematurely". Google. Well there should be something called msiexec that leaves a log file. Somebody else found the problem was only with pip, so don't include that from the checklist. I'll try that, but first, since it has been months since this VM was up, there are 28 important Windows Updates to install. So let that run first.

Yup, removing Pip and several other optional installs from the list enabled the installation to run properly, creating C:\Python34\python.exe. Unfortunately double-clicking that produced a console window with an error about unable to load encodings, but I could see in the message some text like "2.7". A quick google turned up a stack overflow note; yes of course I need to set PYTHONPATH and PYTHONHOME.

Oh crap how do I set environment variables in Windows? It's been years... Windows help was not helpful at all, searching it on "environment variable" and "system variable" produced absolutely nothing relevant. Quick google -- aha, yes, Control Panel, System Properties, Advanced, way at the bottom obscure "Environment Variable" button. Teeny tiny dialog box that cannot be made larger, so editing long strings in a tiny slit of a window about 12 characters wide. Find PYTHONPATH, change all the "Python27" entries to "Python34". Also add a PYTHONHOME var.

Now double-clicking python.exe produces a console window with a prompt. Yay me.

Windows #2

Turns out I already had Wing IDE installed, but an old version. Download and install the latest one. However, it is opening Python 2.7. How to change it. Its help is actually of help! Go to project properties for the default project, click Browse, browse to Python34.exe, click OK... and it is not OK. It claims "Could not launch or inspect the Python executable 'c:\Python34\python.exe'. It should be the name of a Python interpreter that is on your PATH..." Wait, what? On the PATH? But I just took you by the hand and led you to it, there it fucking is, open it!

Double-check, yes, C:\Python34 is the first item in the PATH variable. Actually it was named "Path" but I made a new variable "PATH" with the same contents, which seemed to replace "Path" so probably case didn't matter. But no, Wing won't open it.

Time to quit for the day.

No comments: