在名为< string>的文件中“在缩进中使用制表符和空格不一致”的困难 [英] Difficulty with "inconsistent use of tabs and spaces in indentation"in file called <string>
问题描述
我已经尝试了几天使用pyObjC在
a mac上构建程序,我坚持这个错误:
< string>:缩进中标签和空格的使用不一致
Traceback(最近一次调用最后一次):
文件setup.py,第59行, ?
setup(** setup_options)
File" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 / distutils / core.py",第149行,在设置中
dist.run_commands()
文件" /Library/Frameworks/Python.framework/Versions /2.4//lib/
python2.4 / distutils / dist.py",第946行,在run_commands中
self.run_command(cmd)
文件" /Library/Frameworks/Python.framework/Versions/2.4 //lib/
python2.4 / distutils / dist.py",第966行,在run_command中
cmd_obj.run()
文件" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / build_app.py",第342行,在运行中
self.initialize_plist()
文件" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / build_app.py",第415行,在
initialize_plist
plist = self.get_default_plist ()
文件" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / build_app。 py,第294行,
get_default_plist
version = find_version(target.script)
文件" / Library / Frameworks / Python。 framework / Versions / 2.4 / lib /
python2.4 / site-packages / py2app / py2app / util.py",第13行,
find_version
ast = compiler.parseFile(fn)
File" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 /compiler/transformer.py",第48行,在parseFile中
返回解析(src)
文件" /Library/Frameworks/Python.framework/Ver sions / 2.4 // lib /
python2.4 / compiler / transformer.py",第52行,解析
返回Transformer()。parsesuite(buf)
文件" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 / compiler / transformer.py",第129行,在parsesuite中
返回self.transform(parser.suite(text))
文件"< string>",第628行
else:
^
语法错误:语法无效
我甚至不知道哪个文件有缩进问题。
任何想法。
Ian Bloom
I''ve been trying for a couple days to build a program using pyObjC on
a mac, I''m stuck on this error:
<string>: inconsistent use of tabs and spaces in indentation
Traceback (most recent call last):
File "setup.py", line 59, in ?
setup(**setup_options)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 342, in run
self.initialize_plist()
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 415, in
initialize_plist
plist = self.get_default_plist()
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 294, in
get_default_plist
version = find_version(target.script)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/util.py", line 13, in
find_version
ast = compiler.parseFile(fn)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/compiler/transformer.py", line 48, in parseFile
return parse(src)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/compiler/transformer.py", line 52, in parse
return Transformer().parsesuite(buf)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/compiler/transformer.py", line 129, in parsesuite
return self.transform(parser.suite(text))
File "<string>", line 628
else:
^
SyntaxError: invalid syntax
I don''t even know which file has the indentation problem.
Any thoughts.
Ian Bloom
推荐答案
En Mon,2008年2月11日13: 34:17 -0200,ibloom< ia ******* @ gmail.comescribi ???:
En Mon, 11 Feb 2008 13:34:17 -0200, ibloom <ia*******@gmail.comescribi???:
我一直在尝试一对夫妇使用pyObjC在
a mac上构建程序的日子,我坚持这个错误:
< string>:标签和空格的使用不一致缩进
T. raceback(最近一次打电话):
文件setup.py,第59行,在?
设置(** setup_options)
文件" /Library/Frameworks/Python.framework/Versions/2.4 //lib/
python2.4 / distutils / core.py",第149行,在设置中
dist.run_commands()
文件" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 / distutils / dist。 py",第946行,在run_commands中
self.run_command(cmd)
文件" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 / distutils / dist.py",第966行,在run_command中
cmd_obj.run()
文件" / Library / Frameworks / Python.framework / Versions / 2.4 / lib /
python2.4 / site-packages / py2app / py2app / build_app.py",342行,在运行中
self.initialize_plist()
文件" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / build_app.py",第415行,
initialize_plist
plist = self.get_default_plist()
文件" / Library / Frameworks /Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / build_app.py",第294行,
get_default_plist
version = find_version(target.script)
File" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2 .4 / site-packages / py2app / py2app / util.py",第13行,
find_version
ast = compiler.parseFile(fn)
I''ve been trying for a couple days to build a program using pyObjC on
a mac, I''m stuck on this error:
<string>: inconsistent use of tabs and spaces in indentation
Traceback (most recent call last):
File "setup.py", line 59, in ?
setup(**setup_options)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 342, in run
self.initialize_plist()
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 415, in
initialize_plist
plist = self.get_default_plist()
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 294, in
get_default_plist
version = find_version(target.script)
File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/util.py", line 13, in
find_version
ast = compiler.parseFile(fn)
在该行上方放置一个print语句,以查看哪个文件触发了
错误。
-
Gabriel Genellina
Put a print statement just above that line, to see which file triggers the
error.
--
Gabriel Genellina
2月11日,9:34 * am,ibloom< ianmbl ... @ gmail.comwrote :
On Feb 11, 9:34*am, ibloom <ianmbl...@gmail.comwrote:
我已经尝试了几天使用pyObjC构建程序
a mac,我'我坚持这个错误:
< string>:缩进中使用制表符和空格不一致
Traceback(最近一次调用最后一次):
*文件setup.py,第59行,在?
* * setup(** setup_options)
*文件" / Library /Frameworks/Python.framework/Versions/2.4//lib/
python2.4 / distutils / core.py",第149行,在设置中
* * dist。 run_commands()
*文件" /Library/Frameworks/Python.framework/Versions/2.4 //lib/
python2.4 / distutils / dist.py",第946行,在run_commands中
* * self.run_command(cmd)
*文件" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 / distutils / dist.py",第966行,在run_command中
* * cmd_obj.run()
*文件" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / build_app.py",第342行,在运行中
* * self.initialize_plist()
*文件" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / build_app.py" ;,第415行,在
initialize_plist
* * plist = self.get_default_plist()
*文件" / Library / Frameworks / Python .framework / Versions / 2.4 / lib /
python2.4 / site-packages / py2app / py2app / build_app.py",294行,
get_default_plist
* * version = find_version(target.script)
*文件" /Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4 / site-packages / py2app / py2app / util.py",第13行,
find_version
* * ast = compiler.parseFile(fn)
*文件" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 / compiler / transformer.py",第48行,在parseFile中
* *返回解析(src)
*文件" /Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4 /编译器/transformer.py",第52行,在解析中
* * return Transformer()。parsesuite(buf)
*文件" /Library/Frameworks/Python.framework /Versions/2.4//lib/
python2.4 / compiler / transformer.py",第129行,在parsesuite中
* * return self.transform(parser.suite (文字))
*文件"< string>",第628行
* * else:
* * ^
语法错误:语法无效
我甚至不知道哪个文件有缩进问题。
I''ve been trying for a couple days to build a program using pyObjC on
a mac, I''m stuck on this error:
<string>: inconsistent use of tabs and spaces in indentation
Traceback (most recent call last):
* File "setup.py", line 59, in ?
* * setup(**setup_options)
* File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/core.py", line 149, in setup
* * dist.run_commands()
* File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/dist.py", line 946, in run_commands
* * self.run_command(cmd)
* File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/distutils/dist.py", line 966, in run_command
* * cmd_obj.run()
* File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 342, in run
* * self.initialize_plist()
* File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 415, in
initialize_plist
* * plist = self.get_default_plist()
* File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/build_app.py", line 294, in
get_default_plist
* * version = find_version(target.script)
* File "/Library/Frameworks/Python.framework/Versions/2.4/lib/
python2.4/site-packages/py2app/py2app/util.py", line 13, in
find_version
* * ast = compiler.parseFile(fn)
* File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/compiler/transformer.py", line 48, in parseFile
* * return parse(src)
* File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/compiler/transformer.py", line 52, in parse
* * return Transformer().parsesuite(buf)
* File "/Library/Frameworks/Python.framework/Versions/2.4//lib/
python2.4/compiler/transformer.py", line 129, in parsesuite
* * return self.transform(parser.suite(text))
* File "<string>", line 628
* * else:
* * ^
SyntaxError: invalid syntax
I don''t even know which file has the indentation problem.
也许没有人这样做。由于缩进,缩进错误不一定是
。我上周六刚刚看到一个,但是我不记得是什么原因造成的,除了它不是缩进之外。
有些东西是敞开的,不是正确关闭,例如
匹配()或[]或''''。不幸的是,我无法重现它。
在报告实际的
报告错误之前的部分仔细检查代码。您可能会看到一个症状而不是原因。
Maybe none of them do. An indentation error isn''t necessarily
due to indentation. I just saw one last Saturday, but I don''t
remember what caused it other than it wasn''t indentation.
Something was open that wasn''t closed properly, such as
matching () or [] or ''''. Unfortunately, I can''t reproduce it.
Examine the code carefully in the sections before the actual
reported error. You may be seeing a symptom rather than the cause.
>
任何想法。
Ian Bloom
>
Any thoughts.
Ian Bloom
我的主要问题是,我不知道在哪里找到该文件:
文件"< string> ;",第628行
因为我不知道它所引用的是什么代码< string ??
它不是''我写的代码,它来自python或pyObjC的东西
Ian Bloom
My main problem is, I don''t know where to find the file:
File "<string>", line 628
As in I don''t know what code it is refering to by <string??
It isn''t code that I wrote, its something from python or pyObjC
Ian Bloom
这篇关于在名为< string>的文件中“在缩进中使用制表符和空格不一致”的困难的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!