-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Building numpy on 3.3 with MSVC 2010 does not work #4245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The environment I used: Python 3.3 on Windows 7 64-bit with MSVC 2010 installed (but not on PATH). This is my standard environment for all installs, and works seamlessly for projects like coverage and zmq that include C extensions. Output from a clean attempt to install numpy:
For comparison, here's a coverage install (with
|
this is most likely a python distutils issue and not numpy:
see #4101 for some solutions |
Well, patching my distutils isn't a useful solution. This issue only seems to affect numpy, so it seems reasonable for numpy to work round it, given that the likelihood of a distutils fix is remote (and guaranteed not to be available any earlier than Python 3.5). |
Is this problem specific to Python 3.*? |
Only 3.* uses MSVC 2010. |
While this does look like a distutils bug, it would be good to (a) spell out why |
Update:
|
Has anyone tried to build with Bento + MSVC2010? If that works at least we can tell people to use that combo. |
The problem is that |
True. But it's still a whole lot better to just download the source and invoke Bento than not be able to install it at all. Not saying we shouldn't implement a workaround in distutils. Anyway if we commit a fix now it also won't help until the next release is made. |
I've added a reminder to http://bugs.python.org/issue16296, but the previous comment on there was a question from Marin Von Loewis which has gone unanswered - so it may be that it's languishing because the impression is that whoever posted the bug doesn't care enough to push it forward :-( |
And maybe |
@rgommers not really - in that case you might as well just download Cristoph Gohlke's build, convert to a wheel and pip install that. The original thread here was about uploading numpy wheels to make the pip install experience work - and someone pointed out that pip install numpy works right now, building from source. When it didn't, I was asked to raise this bug by @cournape (who actually raised the issue for me).. |
OK fair point. pip source install won't work until 1.8.1 at the earliest if you have MSVC2010. For 1.8.0 we can discuss uploading no-SSE wheels, given that the SSE2 ones were deemed a bad idea. |
I've just looked at the patch on http://bugs.python.org/issue16296. It doesn't apply cleanly to Python 3.3, and even when I hand-apply it it doesn't fix the |
@pfmoore that's not surprising. Patches almost always take some amount tweaking after they're first submitted by a non-core developer, and especially if they're 1.5 years old. It's so small that a couple of hours spent by someone with a bit of distutils knowledge and the right build env set up should be enough (not suggesting you should do the work). Any volunteers (also for the numpy.distutils fix)? |
Again this link, cause it contains a better fix from @cgohlke: http://mail.scipy.org/pipermail/numpy-discussion/2012-November/064524.html. That thread also reports that the patch on the Python tracker did work for Peter Cock. |
I am having a similar problem with, windows 7: python 3.4 from Visual Studio Express 2013 express for windows Desktop from When I run 'pip install numpy' at the end I get === SNIP ===
Source in c:\users\bradbell\appdata\local\temp\pip_build_bradbell\numpy has version 1.8.1, which satisfies requirement numpy
=== SNIP === File "numpy\core\setup.py", line 682, in get_mathlib_info
RuntimeError: Broken toolchain: cannot link a simple C program |
I get the same issue with python 2.7 on windows 7 and MSVC 2012 |
As pointed out above, I believe the issue that you guys are having boils down to the msvc9compiler.py file in Python3.4.0\Lib\distutils. The reason is that the newer versions of Visual Studio do not include the manifest, which apparently distutils needs. Btw, I have tried this on basically a million virtual machines, with different combinations of Windows and Visual Studio. The Windows version appears to be irrelevant, but I could only get this to work for 32-bit compiling in Visual Studio 2010 Express or Professional. Since the Python project was built with 2010, you will run into error in 2012 or 2013. Express 2010 is free, so just install it. Note on 64 bit: I cannot get the 64-bit compiling to work because of problems compile 64 bit OpenSSL on my machines. Back to the fix.... In the msvc9compiler file, replace:
with:
Since this is a .py file, be very careful to ensure that your indenting is done with spaces (not tabs), and that everything is properly aligned. Apparently the source of this is that older versions of Visual Studio (pre 2010) automatically generated a manifest file, which distutils needs. Once you do this, you might need to rebuild Python. Then can run the "python -m ensurepip" command to get pip, followed by "pip install numpy" to get numpy. Two caviots:
I hope some of this info is useful. |
Just wanted to leave an update to others that the fix provided in //issues/4101 did the trick for me. |
Sounds like we should deal with this. @mcleung Want to make a PR? |
I don't have a Windows box or MSVC license, but I'll try to put together a patch now for |
Note that there are a few similar patches posted to numpygh-4101 and numpygh-4245. Those were all patches to msvc9compiler in Python distutils. Monkeypatching ``MSVCCompiler.link`` is less easy than this change to ``config._check_compiler``; effect should be the same. (cherry picked from commit 2aa755eedf098b2357dcb6d11fa16719ada25ccc)
BLD: fix build issues with MSVC10 on Windows. Closes gh-4245.
BLD: fix build issues with MSVC10 on Windows. Closes gh-4245.
OK fix merged. 1.9.x works with MSVC now, master still has an unrelated issue. |
I'll comment on the Python bug tracker (once) to point out what's wrong, how to fix it and how we work around it. |
Note that there are a few similar patches posted to numpygh-4101 and numpygh-4245. Those were all patches to msvc9compiler in Python distutils. Monkeypatching ``MSVCCompiler.link`` is less easy than this change to ``config._check_compiler``; effect should be the same. Also updates the error message shown when initializing MSVC fails. [ci skip] (cherry picked from commit fa0ec11)
Reported on the distutils-sig by Paul Moore.
The text was updated successfully, but these errors were encountered: