How to install Python package from source on Windows

Deborah Swanson python at deborahswanson.net
Mon May 15 02:14:12 EDT 2017


Chris Angelico wrote, on Sunday, May 14, 2017 9:56 PM
 
> 
> On Mon, May 15, 2017 at 2:26 PM, eryk sun <eryksun at gmail.com> wrote:
> > On Mon, May 15, 2017 at 4:19 AM, Deborah Swanson 
> > <python at deborahswanson.net> wrote:
> >> Unfortunately I don't have Visual Studio 2015+ installed 
> and I can't 
> >> install it on Windows XP SP2 (plus I really don't want 
> to). Probably 
> >> I should have mentioned that, but I didn't know I'd need to build 
> >> C/C++.
> >
> > 3.5+ doesn't work in XP, so the highest version you can run is 3.4. 
> > For 32-bit, install recordclass-0.4.3-cp34-cp34m-win32.whl.
> 
> The best way to install this sort of thing is using pip. You 
> should have it with your Python 3.4, and it'll do all the 
> work of figuring out which one to download.
> 
> ChrisA
> -- 

That was easy to try, "pip install recordclass", but it failed:

C:\Programs\Coding\Anaconda3\Scripts>pip install recordclass
You are using pip version 7.0.3, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade
pip' comm
and.
Collecting recordclass
  Downloading recordclass-0.4.3.tar.gz
Installing collected packages: recordclass
  Running setup.py install for recordclass
    Complete output from command C:\Programs\Coding\Anaconda3\python.exe
-c "imp
ort setuptools,
tokenize;__file__='E:\\temp\\pip-build-zhximvpd\\recordclass\\se
tup.py';exec(compile(getattr(tokenize, 'open',
open)(__file__).read().replace('\
r\n', '\n'), __file__, 'exec'))" install --record
E:\temp\pip-r7ky4fv1-record\in
stall-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.4
    creating build\lib.win32-3.4\recordclass
    copying lib\recordclass\record.py -> build\lib.win32-3.4\recordclass
    copying lib\recordclass\__init__.py ->
build\lib.win32-3.4\recordclass
    creating build\lib.win32-3.4\recordclass\test
    copying lib\recordclass\test\test_memoryslots.py ->
build\lib.win32-3.4\reco
rdclass\test
    copying lib\recordclass\test\test_record.py ->
build\lib.win32-3.4\recordcla
ss\test
    copying lib\recordclass\test\__init__.py ->
build\lib.win32-3.4\recordclass\
test
    running build_ext
    building 'recordclass.memoryslots' extension
    error: Microsoft Visual C++ 10.0 is required (Unable to find
vcvarsall.bat).


    ----------------------------------------
Command "C:\Programs\Coding\Anaconda3\python.exe -c "import setuptools,
tokenize
;__file__='E:\\temp\\pip-build-zhximvpd\\recordclass\\setup.py';exec(com
pile(get
attr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),
__file__, '
exec'))" install --record E:\temp\pip-r7ky4fv1-record\install-record.txt
--singl
e-version-externally-managed --compile" failed with error code 1 in
E:\temp\pip-
build-zhximvpd\recordclass



Looks like lack of Visual C++ tripped me up again.

Strange how Python code can't install with purely Python code. I don't
plan to have Visual anything on Linux either.

It might be possible to do something with 

lib\recordclass\test\test_record.py ->
build\lib.win32-3.4\recordclass\test and 

lib\recordclass\record.py -> build\lib.win32-3.4\recordclass, 

but I wouldn't know what.

Maybe I should go back to Python 2.7.8 for this.

Deborah




More information about the Python-list mailing list