Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PyWin32 installer question

92 views
Skip to first unread message

Skip Montanaro

unread,
Dec 27, 2017, 10:06:51 AM12/27/17
to
I'm fiddling around with Appveyor, trying to build a Windows installer
for SpamBayes. This is complicated by two facts:

1. I don't know squat about Windows.

2. I don't have access to a Windows command line.

Consequently, every new attempt requires a change to appveyor.yml and
a git push command. Rather slow going. My latest Appveyor build number
is 59. Most of the changes were simple fixes for syntax errors.

I got to the point where I (finally!) was able to successfully
download the appropriate pywin32 installer, but executing it just
hangs. I sort of assume it's asking os.devnull for something. Alas, I
couldn't find any sort of command line flags for the installer itself
in the pywin32 code. I've tried

pywin32.exe /h

but that just sits there (ignores that flag?) and

pywin32.exe /?

which produced some inscrutable output.

Is there some way to coax it into giving me some help and exiting?

Thanks,

Skip

Paul Moore

unread,
Dec 28, 2017, 12:15:54 PM12/28/17
to
When I took a quick look at the code, it seemed to be based on a
pretty old version of Python. What version are you using? If it's 2.7
(or better still, Python 3!) then you should have pip available. In
which case you may be better off using pypiwin32, which is a
rebundling of pywin32 as a wheel. "python -m pip install pypiwin21"
should work for you. You may need to force the version to be 219, as
there's only Python 3.6 wheels for version 220 (do this as "python -m
pip install pypiwin32==219") - but I don't think you'll need this, pip
should limit itself to compatible wheels.

Unfortunately, pywin32 is one of the worst extensions to install, as
the project doesn't supply official wheels, and some of the COM stuff
needs registration, which in the wininst script is handled by a
post-install step, but I've no idea how you do that with a wheel - you
may need to ask the project maintainers for advice.

Paul
> --
> https://mail.python.org/mailman/listinfo/python-list

Skip Montanaro

unread,
Dec 28, 2017, 12:51:04 PM12/28/17
to
Thanks for the help, Paul.

> When I took a quick look at the code, it seemed to be based on a
> pretty old version of Python. What version are you using?

Yes, last time a Windows installer was created, Python 2.5 was still
in vogue. I switched things to 2.7 with (so far) no obvious problems.

I eventually got past the pywin32 install hassles you referred to when
I stumbled on the pypiwin32 package:

https://pypi.python.org/pypi/pypiwin32/220

On the PyPI site, it does, indeed, look like only Python 3 is
supported, but it seemed to download and install a 2.7 version. This
is from my latest 32-bit build:

pip install py2exe_py2 pypiwin32 Pillow lockfile
Collecting py2exe_py2
Downloading py2exe_py2-0.6.9-cp27-none-win32.whl (134kB)
Collecting pypiwin32
Downloading pypiwin32-219-cp27-none-win32.whl (6.7MB)
Collecting Pillow
Downloading Pillow-4.3.0-cp27-cp27m-win32.whl (1.3MB)
Collecting lockfile
Downloading lockfile-0.12.2-py2.py3-none-any.whl

(I guess it fell back to 219 automatically. Clever tool, that pip...)

So, I'm past that hurdle, and eventually got a successful 32-bit build:

https://ci.appveyor.com/project/smontanaro/spambayes/build/job/5pflj8b6t3qn0naw/artifacts

but now I'm fumbling around with 64-bit (my holy grail, as most
Outlook users are running a 64-bit version, at least based on the
install questions we get on the SpamBayes mailing list):

pip install py2exe_py2 pypiwin32 Pillow lockfile
Collecting py2exe_py2
Could not find a version that satisfies the requirement py2exe_py2
(from versions: )

That error message isn't telling me much about why the requirement
isn't satisfied.

The name of the wheel file suggests that it's architecture-independent:

py2exe_py2-0.6.9-cp27-none-win32.whl

Any idea what it's complaining about?

Skip

Paul Moore

unread,
Dec 28, 2017, 5:28:38 PM12/28/17
to
On 28 December 2017 at 17:49, Skip Montanaro <skip.mo...@gmail.com> wrote:
> pip install py2exe_py2 pypiwin32 Pillow lockfile
> Collecting py2exe_py2
> Could not find a version that satisfies the requirement py2exe_py2
> (from versions: )
>
> That error message isn't telling me much about why the requirement
> isn't satisfied.
>
> The name of the wheel file suggests that it's architecture-independent:
>
> py2exe_py2-0.6.9-cp27-none-win32.whl
>
> Any idea what it's complaining about?

That's not an architecture-independent file. The Wheel spec gives all
the details, but "cp27" (as opposed to "py27") means it's CPython only
(which usually means it's got a C extension) and "win32" is 32-bit
only ("win_amd64" is the tag for 64-bit Windows). So the problem is
that the py2exe_py2 maintainer doesn't supply a 64-bit build. You
could ask the maintainers if they could supply a 64-bit build. You may
be able to build your own copy, but without a Windows system, doing so
on Appveyor will be a real pain. Another option is to use Christoph
Gohlke's builds, from
https://www.lfd.uci.edu/~gohlke/pythonlibs/#py2exe - you have to
download the wheel file manually (the site doesn't support automated
downloads) and then upload it to Appveyor somehow (maybe by keeping a
copy of the wheel in the project repo). Also the version there is
0.6.10a1 which looks like an alpha rather than the last official
release. So I guess there may be issues with that. Worst case scenario
would be to switch to something other than py2exe - cx_Freeze seems
similar and pretty good, and it *does* ship 64-bit Python 2.7 wheels.
But that's obviously a non-trivial task.

Welcome to the bad old days of trying to find Windows binaries for
Python packages :-( I'd strongly recommend moving to Python 3, as the
situation is immensely improved there - most projects ship Python 3
binary wheels, and "pip install" just works in many cases. But I
appreciate that doesn't help much for you. Sorry - hopefully one of
the other options above will help.

Paul

wxjm...@gmail.com

unread,
Dec 29, 2017, 3:57:09 AM12/29/17
to
C:\Users\Lætitia_MUŸ>echo You are so right...
You are so right...

C:\Users\Lætitia_MUŸ>

-----

PS C:\Users\Lætitia_MUŸ> Write-Output "Your are so right..."
Your are so right...
PS C:\Users\Lætitia_MUŸ>

Skip Montanaro

unread,
Dec 29, 2017, 10:59:39 AM12/29/17
to
> That's not an architecture-independent file. The Wheel spec gives all
> the details, but "cp27" (as opposed to "py27") means it's CPython only
> (which usually means it's got a C extension) and "win32" is 32-bit
> only ("win_amd64" is the tag for 64-bit Windows). So the problem is
> that the py2exe_py2 maintainer doesn't supply a 64-bit build.

Thanks. I'll shoot Thomas Heller an email...

S

Skip Montanaro

unread,
Dec 29, 2017, 11:05:26 AM12/29/17
to
> Thanks. I'll shoot Thomas Heller an email...


Actually, make that Christopher Toth. Seems he's the current maintainer.

Paul Moore

unread,
Dec 29, 2017, 11:39:00 AM12/29/17
to
On 29 December 2017 at 16:04, Skip Montanaro <skip.mo...@gmail.com> wrote:
>> Thanks. I'll shoot Thomas Heller an email...
>
>
> Actually, make that Christopher Toth. Seems he's the current maintainer.

If you get no joy there, then in a week or two, when I next get access
to a system with a Python 2.x build environment on it, I can see if I
can do a 64-bit build for you. Ping me if that would be a help.

Paul

Terry Reedy

unread,
Dec 29, 2017, 2:25:45 PM12/29/17
to
I have not followed this thread, but there may be no need to.
https://www.lfd.uci.edu/~gohlke/pythonlibs/
Christopher Gohlke, at UC Irvine, provides Windows cpxx wheels for about
300 packages, for 2.7, 3.4, 3.5, 3.6, 3.7, in win32 and win_amd64
versions (as applicable). PyWin32-221 is included, with all combinations.

--
Terry Jan Reedy

0 new messages