How to install Python package from source on Windows

Paul Moore p.f.moore at gmail.com
Wed May 24 08:53:18 EDT 2017


On Monday, 15 May 2017 22:42:22 UTC+1, Deborah Swanson  wrote:
> MRAB wrote, on Monday, May 15, 2017 12:44 PM
> > 
> > On 2017-05-15 13:52, eryk sun wrote:
> > > On Mon, May 15, 2017 at 6:37 AM, Deborah Swanson 
> > > <python at deborahswanson.net> wrote:
> > >>
> > >> Where did you find recordclass-0.4.3-cp34-cp34m-win32.whl?  There 
> > >> weren't any win32 builds on 
> > https://pypi.python.org/pypi/recordclass.
> > > 
> > > It's in the 
> > middle of the file list:
> > > 
> > >     recordclass-0.4.3-cp34-cp34m-win32.whl (md5) Python Wheel cp34 
> > > 2017-04-17 17KB
> > > 
> > > Maybe you're looking at a cached page in your browser? But that 
> > > doesn't explain why pip doesn't see it.
> > > 
> > >> Maybe I can find an earlier 3 build that won't demand Visual C++.
> > > 
> > > The wheel doesn't need a compiler. It has an ABI tag because it 
> > > already includes the compiled extension module.
> > > 
> > I used pip to install into Python 3.4 (32-bit) from PyPI. It fetched 
> > "recordclass-0.4.3.tar.gz" and compiled it instead of fetching 
> > "recordclass-0.4.3-cp34-cp34m-win32.whl".
> > 
> > Why?
> 
> Excellent question, though I have no clue what the answer is.
> 
> > Come to think of it, what's that "cp34m" in the name? I don't have
> that 
> > in the regex module's wheels, I have "none" instead.
> 
> Another excellent question. "cp" in "cp34m" might stand for C++, but if
> so, what's the rest of it mean? Or maybe "CPython 3.4" plus "m"
> (whatever "m" stands for)?
> 
> What's "the regex module's wheels"? I certainly don't know, though I
> know vague outines of what "regex" and "wheel" are.
>  
> > Rename "recordclass-0.4.3-cp34-cp34m-win32.whl" to 
> > "recordclass-0.4.3-cp34-name-win32.whl".
> > 
> > With the new name, it installs and seems to work!
> 
> Most excellent and I will try it. 

I don't know whether you solved your issue, but in case you didn't, the problem is that the "cp34m" part of the name indicates the "ABI" used in the extension (roughly, how the C part of the code links to the Python interpreter). Older versions of pip (such as the one shipped with Python 3.4, which is itself a bit old now) didn't recognise that tag, and so won't install that wheel.

The best way to fix this is to upgrade the copy of pip you have, using

   python -m pip install --upgrade pip

When you do that, you'll get a version of pip that recognises the "cp34m" tag, and "pip install recordclass" should then just work.

Hope this helps,
Paul



More information about the Python-list mailing list