Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue4931

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:distutils does not show any error msg when can't build C module extensions due to a missing C compiler
Type:behaviorStage:resolved
Components:Distutils, Distutils2Versions:Python 3.3, Python 3.4, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: eric.araujoNosy List: amaury.forgeotdarc, eric.araujo, giampaolo.rodola, jafo, loewis, python-dev, takluyver, tarek
Priority:normalKeywords:patch

Created on2009-01-13 17:31 bygiampaolo.rodola, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
distutils_ioerror.patchamaury.forgeotdarc,2009-01-14 10:25review
Messages (15)
msg79751 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2009-01-13 17:31
Today I was trying to compile a module using an extension in C andnoticed there are differences between compiling it on Python 2.5 and 2.6.I was trying to compile psutil (svn checkouthttp://psutil.googlecode.com/svn/trunk/ psutil) but I think that theproblem may occur with any other package using C extensions.Python 2.5:D:\pyftpdlib\svn\psutil\trunk>C:\python25\python.exe setup.py installrunning installrunning buildrunning build_exterror: Python was built with Visual Studio 2003;extensions must be built with a compiler than can generate compatiblebinaries.Visual Studio 2003 was not found on this system. If you have Cygwininstalled,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 installrunning installrunning buildrunning build_extbuilding 'psutil/_psutil_mswindows' extensionerror: None
msg79767 -(view)Author: Martin v. Löwis (loewis)*(Python committer)Date: 2009-01-13 18:52
What is the specific error you are reporting?
msg79769 -(view)Author: Giampaolo Rodola' (giampaolo.rodola)*(Python committer)Date: 2009-01-13 18:57
Currently I haven't any C compiler installed on my system so I expectdistutils 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)*(Python committer)Date: 2009-01-14 10:25
The problem has two causes:- IOError is raised when no compiler is found. DistutilsPlatformErrorshould be used instead, this was fixed by#4702.- the distutils.util.grok_environment_error function transforms aIOError("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)*(Python committer)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)*(Python committer)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)*(Python committer)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)*(Python committer)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)*(Python committer)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 buildrunning buildrunning build_pycopying psutil\compat.py -> build\lib.win32-2.7\psutilcopying psutil\error.py -> build\lib.win32-2.7\psutilcopying psutil\_psbsd.py -> build\lib.win32-2.7\psutilcopying psutil\_pslinux.py -> build\lib.win32-2.7\psutilcopying psutil\_psmswindows.py -> build\lib.win32-2.7\psutilcopying psutil\_psosx.py -> build\lib.win32-2.7\psutilcopying psutil\_psposix.py -> build\lib.win32-2.7\psutilcopying psutil\__init__.py -> build\lib.win32-2.7\psutilrunning build_extbuilding '_psutil_mswindows' extensionerror: Unable to find vcvarsall.batAlthough 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: <source>", 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)*(Python committer)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 alsomsg200785 for a report from setuptools with an easy to reuse test case.
msg213207 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2014-03-12 07:15
New changeseta865f6fb82b4 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)(Python triager)Date: 2014-03-12 07:19
New changeset0f1237b61f58 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)(Python triager)Date: 2014-03-12 08:11
New changeset504eb00998f2 by Éric Araujo in branch '3.3':Avoid “error: None” messages from distutils (#4931).http://hg.python.org/cpython/rev/504eb00998f2New changesetc7bd0f953687 by Éric Araujo in branch 'default':Merge 3.3 (#4931)http://hg.python.org/cpython/rev/c7bd0f953687
msg213219 -(view)Author: Éric Araujo (eric.araujo)*(Python committer)Date: 2014-03-12 08:25
Happy to close this as fixed.
History
DateUserActionArgs
2022-04-11 14:56:44adminsetgithub: 49181
2014-03-12 08:25:30eric.araujosetstatus: open -> closed
resolution: accepted -> fixed
messages: +msg213219

stage: patch review -> resolved
2014-03-12 08:11:09python-devsetmessages: +msg213213
2014-03-12 07:19:45python-devsetmessages: +msg213208
2014-03-12 07:15:04python-devsetnosy: +python-dev
messages: +msg213207
2014-03-07 22:56:02eric.araujosetmessages: +msg212909
versions: + Python 3.3, Python 3.4, - 3rd party, Python 3.1, Python 3.2
2014-03-07 22:52:27eric.araujolinkissue19333 superseder
2014-03-07 22:50:08takluyversetnosy: +takluyver
messages: +msg212907
2010-11-06 12:12:51giampaolo.rodolasetmessages: +msg120611
2010-11-06 06:42:22eric.araujosetmessages: +msg120588
2010-09-30 01:49:58eric.araujosetversions: + 3rd party, Python 3.2, - Python 2.6, Python 3.0
messages: +msg117690

assignee:tarek ->eric.araujo
keywords: -needs review
type: behavior
stage: patch review
2010-05-16 18:12:32eric.araujosetnosy: +eric.araujo
2010-03-20 19:51:41tareksetnosy:loewis,jafo,amaury.forgeotdarc,giampaolo.rodola,tarek
messages: +msg101390
resolution: accepted
components: + Distutils2
2010-03-20 18:42:37jafosetpriority: normal
nosy: +jafo
messages: +msg101389

2009-02-06 01:28:03tareksetassignee:tarek
nosy: +tarek
2009-01-14 10:25:24amaury.forgeotdarcsetkeywords: +needs review,patch
nosy: +amaury.forgeotdarc
messages: +msg79845
files: +distutils_ioerror.patch
2009-01-13 18:57:52giampaolo.rodolasetmessages: +msg79769
2009-01-13 18:52:00loewissetnosy: +loewis
messages: +msg79767
2009-01-13 17:31:05giampaolo.rodolacreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp