building C extensions with MSVC in Anaconda 3.5

1 view
Skip to first unread message

andy....@gmail.com

unread,
Nov 13, 2015, 4:52:03 PM11/13/15
to Anaconda - Public
Hi all,

I know this a perennial question, but in the upgrade to python 3.5 I seem to have broken my ability to compile C extensions. Environment is Win7x64, have MSVC10 and the 7.1SDK installed. Build within the MS SDK command shell for the right env variable settings, still need to set MSSDK=1 and set DISTUTILS_USE_SDK=1. Finds MSVC10 just fine and starts running, but then linking fails like so:


Failed to build scikit-monaco
Installing collected packages: scikit-monaco
  Running setup.py install for scikit-monaco
    Complete output from command C:\Users\andrewb\AppData\Local\Continuum\Anacon
da3\python.exe -c "import setuptools, tokenize;__file__='C:\\Users\\andrewb\\App
Data\\Local\\Temp\\pip-build-ajm7z5yj\\scikit-monaco\\setup.py';exec(compile(get
attr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, '
exec'))" install --record C:\Users\andrewb\AppData\Local\Temp\pip-0k_zyys_-recor
d\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running config_cc
    unifing config_cc, config, build_clib, build_ext, build commands --compiler
options
    running config_fc
    unifing config_fc, config, build_clib, build_ext, build commands --fcompiler
 options
    running build_src
    build_src
    building extension "skmonaco._core" sources
    building extension "skmonaco._mc" sources
    building extension "skmonaco._miser" sources
    building data_files sources
    build_src: building npy-pkg config files
    running build_py
    running build_ext
    No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying f
rom distutils
    customize MSVCCompiler
    customize MSVCCompiler using build_ext
    building 'skmonaco._core' extension
    compiling C sources
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\cl.exe /c /
nologo /Ox /W3 /GL /DNDEBUG /MT -IC:\Users\andrewb\AppData\Local\Continuum\Anaco
nda3\lib\site-packages\numpy\core\include -IC:\Users\andrewb\AppData\Local\Conti
nuum\Anaconda3\lib\site-packages\numpy\core\include -IC:\Users\andrewb\AppData\L
ocal\Continuum\Anaconda3\include -IC:\Users\andrewb\AppData\Local\Continuum\Anac
onda3\include -I"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE"
 -I"C:\Program Files\Microsoft SDKs\Windows\v7.1\INCLUDE" -I"C:\Program Files\Mi
crosoft SDKs\Windows\v7.1\INCLUDE\gl" /Tcskmonaco\_core.c /Fobuild\temp.win-amd6
4-3.5\Release\skmonaco\_core.obj
    Found executable C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\
amd64\cl.exe
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\link.exe /n
ologo /INCREMENTAL:NO /LTCG /nodefaultlib:libucrt.lib ucrt.lib /DLL /MANIFEST:EM
BED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\andrewb\AppData\Local\Continuum\Anaco
nda3\libs /LIBPATH:C:\Users\andrewb\AppData\Local\Continuum\Anaconda3\PCbuild\am
d64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Lib\amd64"
/LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\X64" m.lib /EXPORT:Py
Init__core build\temp.win-amd64-3.5\Release\skmonaco\_core.obj /OUT:build\lib.wi
n-amd64-3.5\skmonaco\_core.cp35-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.5\R
elease\skmonaco\_core.cp35-win_amd64.lib
    Found executable C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\
amd64\link.exe
    error: Command "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\a
md64\link.exe /nologo /INCREMENTAL:NO /LTCG /nodefaultlib:libucrt.lib ucrt.lib /
DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\andrewb\AppData\Local
\Continuum\Anaconda3\libs /LIBPATH:C:\Users\andrewb\AppData\Local\Continuum\Anac
onda3\PCbuild\amd64 /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 10.
0\VC\Lib\amd64" /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\X64"
m.lib /EXPORT:PyInit__core build\temp.win-amd64-3.5\Release\skmonaco\_core.obj /
OUT:build\lib.win-amd64-3.5\skmonaco\_core.cp35-win_amd64.pyd /IMPLIB:build\temp
.win-amd64-3.5\Release\skmonaco\_core.cp35-win_amd64.lib" failed with exit statu
s 1117
    LINK : fatal error LNK1117: syntax error in option 'MANIFEST:EMBED,ID=2', 

I'm not sure what version of MSVC Anaconda 3.5 was built with... is this an issue of needing to switch to yet another version of MSVC to build, or is there something else weird happening here?

Thanks,

Andy

Chris Barker

unread,
Nov 13, 2015, 5:43:59 PM11/13/15
to anaconda
On Fri, Nov 13, 2015 at 1:52 PM, <andy....@gmail.com> wrote:
I know this a perennial question, but in the upgrade to python 3.5 I seem to have broken my ability to compile C extensions. Environment is Win7x64, have MSVC10

I'm pretty sure that the python.org 3.5 went with a newer compiler -- VS2015? And Anaconda has always maintained compatibility.

This should be documented on python.org -- and there should be an Express (free of charge) version of the compmiler availabe from MS.

-CHB




 

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at http://groups.google.com/a/continuum.io/group/anaconda/.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Ryan

unread,
Nov 13, 2015, 7:15:07 PM11/13/15
to Anaconda - Public, andy....@gmail.com
Yes, Python 3.5 uses MSVC2015. We use MSVC2015 to compile all Python 3.5 packages as well.
Here is a blog post by Steve Dower (of Microsoft) that explains things in greater detail.
http://stevedower.id.au/blog/building-for-python-3-5/
-Ryan

anntz...@gmail.com

unread,
Dec 15, 2015, 9:52:00 PM12/15/15
to Anaconda - Public, andy....@gmail.com
Hi,
I am having the same issue (exact same error) but with MSVC15 (and Win7x64, Python3.5).
Any help would be welcome!
Antony

Antony Lee

unread,
Dec 15, 2015, 10:11:04 PM12/15/15
to Anaconda - Public, andy....@gmail.com
Hum, maybe due to MSVC2010 and 2015 coexisting on the same computer and a messed up PATH... I'll investigate.

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to a topic in the Google Groups "Anaconda - Public" group.
To unsubscribe from this topic, visit https://groups.google.com/a/continuum.io/d/topic/anaconda/cTz7cVPQkKM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to anaconda+u...@continuum.io.

To post to this group, send email to anac...@continuum.io.

Michael Sarahan

unread,
Dec 15, 2015, 10:15:40 PM12/15/15
to Anaconda - Public, andy....@gmail.com
Messed up PATH, maybe, but not 2010 and 2015 coexisting.  That is totally OK - our build VMs have 2008, 2010, and 2015 all installed.

For what little it's worth, I have my home machine, which I used to have set up for MinGW compiling.  I have not figured out how to get it to default to MSVC instead.  I have uninstalled all Anaconda stuff, and reinstalled it.  There must be some config file in some home folder somewhere that dictates this behavior.  I just haven't found it yet.

You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.

Matt Craig

unread,
Dec 16, 2015, 11:36:10 AM12/16/15
to Anaconda - Public, andy....@gmail.com
Hi,

> There must be some config file in some home folder somewhere that dictates this behavior.  I just haven't found it yet.

Make sure `libpython` is not installed.

> Hum, maybe due to MSVC2010 and 2015 coexisting on the same computer and a messed up PATH... I'll investigate.

I also have a VM with 2008, 2010, 2015 installed. If you have opened a CMD shell for, e.g. 2010, it will not work with the other versions. I think 2015, under the VIsual Studio 2015 menu, has a CMD shell shortcut that is properly configured...or just open a plain old CMD shell and it seems to work without additional configuration (which is really nice).

Matt

Antony Lee

unread,
Dec 16, 2015, 12:44:33 PM12/16/15
to Anaconda - Public, Andy Berner
I figured it out -- I had installed VS but not the compiler itself, so it was finding the old compiler.  After downloading another 5Go that issue was fixed :/
Reply all
Reply to author
Forward
0 new messages