在Xcode 11.5中构建kivyios应用程序失败,出现Python语法错误

2024-04-26 04:44:52 发布

您现在位置:Python中文网/ 问答频道 /正文

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

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版本中,这似乎是不匹配的。 直接从虚拟环境运行编译脚本不会出现任何错误:

/Users/martinprater/ios/dist/hostpython3/bin/python -m compileall -f -b "$PROJECT_DIR"/YourApp

我尝试通过pyenv全局设置Python环境,并通过预构建脚本使用python3.8.2强制执行。 然而,它似乎在Xcode(11.5)中不起作用

我试过:

  • 使用虚拟环境和全局安装具有相同的效果
  • Python 3.7和Python 3.8->;同样的效果
  • 重新安装Xcode并重建所有配方->;没有变化

非常感谢您的帮助。 谢谢 马丁


Tags: pyyouifiswithnotmeanusers