首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Xcode 11.5中构建kivy-ios应用程序失败了Python语法错误

在Xcode 11.5中构建kivy-ios应用程序失败了Python语法错误
EN

Stack Overflow用户
提问于 2020-07-15 16:00:07
回答 1查看 507关注 0票数 1

我已经使用工具链为iOS构建了我的kivy应用程序。在打开生成的xcode项目并启动构建过程后,我会收到以下错误。

代码语言:javascript
运行
复制
Listing '/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/stopwining.xcodeproj/xcuserdata/martinprater.xcuserdatad/xcschemes'...
/Users/martinprater/ios/stopwining-ios/YourApp/.buildozer/android/app/lib/python3.8/site-packages/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
  raise TypeError("%s and %s are not of the same version" (a, b))
/Users/martinprater/ios/stopwining-ios/YourApp/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/stopwiningmobile/kivy/extras/highlight.py:45: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if len(sys.argv) is not 4:
/Users/martinprater/ios/stopwining-ios/YourApp/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/stopwiningmobile/kivy/uix/behaviors/focus.py:463: SyntaxWarning: "is" with a literal. Did you mean "=="?
  walk_tree = 'walk' if focus_dir is 'focus_next' else 'walk_reverse'
/Users/martinprater/ios/stopwining-ios/YourApp/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/stopwiningmobile/kivy/uix/behaviors/focus.py:476: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if focus_dir is 'focus_next':
/Users/martinprater/ios/stopwining-ios/YourApp/.buildozer/android/platform/build-armeabi-v7a/build/python-installs/stopwiningmobile/kivy/uix/behaviors/knspace.py:460: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if parent_knspace is not 0:
/Users/martinprater/ios/stopwining-ios/YourApp/build/hostpython3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/hostpython3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/hostpython3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/python3/arm64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/python3/arm64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/python3/arm64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/python3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/python3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/build/python3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/site-packages/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
  raise TypeError("%s and %s are not of the same version" (a, b))
/Users/martinprater/ios/stopwining-ios/YourApp/lib/python3.8/site-packages/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
  raise TypeError("%s and %s are not of the same version" (a, b))
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/.buildozer/android/app/lib/python3.8/site-packages/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
  raise TypeError("%s and %s are not of the same version" (a, b))
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/hostpython3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/hostpython3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/hostpython3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/python3/arm64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/python3/arm64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/python3/arm64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/python3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/python3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/build/python3/x86_64/Python-3.8.2/Lib/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/lib2to3/tests/data/py3_test_grammar.py:652: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 is 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/lib2to3/tests/data/py3_test_grammar.py:653: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/lib2to3/tests/data/py3_test_grammar.py:656: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/dist/hostpython3/lib/python3.8/site-packages/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
  raise TypeError("%s and %s are not of the same version" (a, b))
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/lib/python3.8/site-packages/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
  raise TypeError("%s and %s are not of the same version" (a, b))
/Users/martinprater/ios/stopwining-ios/YourApp/stopwining-ios/YourApp/stopwining-ios/YourApp/lib/python3.8/site-packages/pip/_vendor/ipaddress.py:1106: SyntaxWarning: 'str' object is not callable; perhaps you missed a comma?
  raise TypeError("%s and %s are not of the same version" (a, b))
Command PhaseScriptExecution failed with a nonzero exit code 

在python版本中,这似乎是不匹配的。直接从我的虚拟环境运行编译脚本可以正常工作,不会出现任何错误:

代码语言:javascript
运行
复制
/Users/martinprater/ios/dist/hostpython3/bin/python -m compileall -f -b "$PROJECT_DIR"/YourApp

我尝试通过pyenv和预构建脚本在全局上设置Python环境,以强制使用Python3.8.2。然而,它似乎没有在Xcode (11.5)中生效。

我试过:

使用虚拟env和全局安装具有相同效果的effect

  • Reinstalling

  • Python3.7和Python3.8 ->相同的-> Xcode和重建所有菜谱->没有变化。

任何帮助都会受到热烈的感谢。谢谢,马丁

EN

回答 1

Stack Overflow用户

发布于 2020-09-29 22:00:43

为了解决这个问题,我们必须将==改为is

这是完整的博客https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62919000

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档