Sunday, April 12, 2015

Opening the Window (7)

Earlier this week on my Windows 7 VM I downloaded and installed the official Python 3.4.3 distribution (as well as Qt5.4, Sip, and PyQt5.4) and thought I had pretty well got my Python environment set up. I could run python from the DOS command line, and WingIDE found it and all.

However, the first time I tried to run PPQT under Wing, it immediately reminded me that it couldn't find hunspell. Doh! of course, I need to install the four packages PPQT depends on: regex, sortedcontainers, natsort and hunspell. Well, that shouldn't be hard, just pip-pip-pip.

Well, of course not. First off, on my Unix-type boxes I'm used to pip being a command, a script in /usr/bin. Not Windows. There's no pip command to be found anywhere on the path. So I search the internet. Ah, in Windows one uses the command Python -m pip. All right, I've gotten used to ending a Python session with ctl-z, return; I can get used to this.

I do that—and there is no module named 'pip'.

Search around some more. According to what I see, pip is definitely supposed to be automatically included with Python3. But not mine! Oh, alright then, I go to pypi and download the pip package, which is of course a tar.gz file. Which Windows does not know how to open! It only knows how to open ordinary zips.

Back to my search window. How to open a tar.gz file on Windows? Top recommendation, install 7Zip. Which I do. And now I can unpack the pip distribution file.

So, cd into the folder and there is the usual setup.py. OK, I know what to do: "python setup.py install". No, of course not. Because that tries to import setup tools, and that doesn't exist in my nice new Python 3.4 installation.

Back to pypi and download ez_setup. Run that, and I now have setup tools. Now I can run pip's setup.py. And I've got the pip.

So install natsort and test it. Good. Install regex, test. Good. Install sortedcontainers, test. Good.

Take deep breath. python -m pip install hunspell. Nope. "error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)". Well, kind of expected. So I need to get that. I'm sure it's available. But it's nearly 6pm Sunday and it will just have to wait for... probably Thursday, at a guess.

No comments: