msg79751 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2009-01-13 17:31 |
Today I was trying to compile a module using an extension in C and noticed there are differences between compiling it on Python 2.5 and 2.6. I was trying to compile psutil (svn checkout http://psutil.googlecode.com/svn/trunk/ psutil) but I think that the problem may occur with any other package using C extensions. Python 2.5: D:\pyftpdlib\svn\psutil\trunk>C:\python25\python.exe setup.py install running install running build running build_ext error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py. Python 2.6: D:\pyftpdlib\svn\psutil\trunk>C:\python26\python.exe setup.py install running install running build running build_ext building 'psutil/_psutil_mswindows' extension error: None |
|
|
msg79767 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2009-01-13 18:52 |
What is the specific error you are reporting? |
|
|
msg79769 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2009-01-13 18:57 |
Currently I haven't any C compiler installed on my system so I expect distutils to report that every time I try to compile a C module extension. Python 2.5 did that while Python 2.6 does not. |
|
|
msg79845 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2009-01-14 10:25 |
The problem has two causes: - IOError is raised when no compiler is found. DistutilsPlatformError should be used instead, this was fixed by #4702. - the distutils.util.grok_environment_error function transforms a IOError("Unable to find vcvarsall.bat") into "error: None". This function should not be used IMO. Its docstring claims that it "Handles Python 1.5.1 and 1.5.2 styles", but str() does a better job... Patch attached. |
|
|
msg101389 - (view) |
Author: Sean Reifschneider (jafo) *  |
Date: 2010-03-20 18:42 |
Tarek: This patch seems reasonable to me, is this something that can be applied? |
|
|
msg101390 - (view) |
Author: Tarek Ziadé (tarek) *  |
Date: 2010-03-20 19:51 |
I guess i can be applied on distutils, and backported in distutils2. I'll do it in the coming days. Notice that I am now applying only bug fixes and regression fixes now for distutils. |
|
|
msg117690 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-09-30 01:49 |
I will commit this if Tarek does not do it shortly. In distutils2, I’ll remove grok_environment_error wholly, since it exists for 1.5 compat only. |
|
|
msg120588 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2010-11-06 06:42 |
Giampaolo, can you test Amaury’s patch? I’d prefer some testing before committing. |
|
|
msg120611 - (view) |
Author: Giampaolo Rodola' (giampaolo.rodola) *  |
Date: 2010-11-06 12:12 |
I don't have the same setup I had at the time when I submitted the first message so maybe something has changed in meantime. Below is what I get on Windows 2000 SP-3, no VS installed, python 2.7, before and after the patch. C:\Documents and Settings\foo\Desktop\psutil>setup.py build running build running build_py copying psutil\compat.py -> build\lib.win32-2.7\psutil copying psutil\error.py -> build\lib.win32-2.7\psutil copying psutil\_psbsd.py -> build\lib.win32-2.7\psutil copying psutil\_pslinux.py -> build\lib.win32-2.7\psutil copying psutil\_psmswindows.py -> build\lib.win32-2.7\psutil copying psutil\_psosx.py -> build\lib.win32-2.7\psutil copying psutil\_psposix.py -> build\lib.win32-2.7\psutil copying psutil\__init__.py -> build\lib.win32-2.7\psutil running build_ext building '_psutil_mswindows' extension error: Unable to find vcvarsall.bat Although the message is improved ("Unable to find vcvarsall.bat" vs "None") it seems the patch had no effect. |
|
|
msg212907 - (view) |
Author: Thomas Kluyver (takluyver) * |
Date: 2014-03-07 22:50 |
Any chance of getting this patch applied? It clearly makes the error message more useful, and we've run into another case where grok_environment_error gives the wrong result: when symlinking fails because the target exists, it now says "File exists: ", because e.filename is the source and e.filename2 the target. It's also rather embarassing that a function in Python 3.4 still says "Handles Python 1.5.1 and 1.5.2 styles..." in the docstring. |
|
|
msg212909 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2014-03-07 22:56 |
I want to make time for Python bugs again, so I’ll try and finish this bug soon. See also for a report from setuptools with an easy to reuse test case. |
|
|
msg213207 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-03-12 07:15 |
New changeset a865f6fb82b4 by Éric Araujo in branch '2.7': Avoid “error: None” messages from distutils (#4931). http://hg.python.org/cpython/rev/a865f6fb82b4 |
|
|
msg213208 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-03-12 07:19 |
New changeset 0f1237b61f58 by Éric Araujo in branch '2.7': Restore missing part of error message (#4931) http://hg.python.org/cpython/rev/0f1237b61f58 |
|
|
msg213213 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-03-12 08:11 |
New changeset 504eb00998f2 by Éric Araujo in branch '3.3': Avoid “error: None” messages from distutils (#4931). http://hg.python.org/cpython/rev/504eb00998f2 New changeset c7bd0f953687 by Éric Araujo in branch 'default': Merge 3.3 (#4931) http://hg.python.org/cpython/rev/c7bd0f953687 |
|
|
msg213219 - (view) |
Author: Éric Araujo (eric.araujo) *  |
Date: 2014-03-12 08:25 |
Happy to close this as fixed. |
|
|