kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
758 stars 238 forks source link

Toolchain Build error - commandnotfound python #748

Closed FMA93 closed 1 year ago

FMA93 commented 1 year ago

This is the first time I'm creating a thread, hope I don't make any errors. Usually I can find the answer to my issues on pre existing threads but this time I can't find a solution.

I'm creating an app with python kivy, I already succesfully created an apk with buildozer. But when I want to convert my python kivy to an xcode project I get a confusing error with the toolchain build.

The instruction I use is: toolchain build python3 kivy openssl After a long process I eventually get the following error noted below.

I don't understand the error message, because I have python installed and up to date on my mac. Does anyone know what could be the issue with this? I truly hope you do. I already tried uninstalling and reinstalling python hoping it would fix it but it didn't.

IOSSFB % toolchain build python3 kivy openssl
[INFO    ] Building with 4 processes, where supported
[INFO    ] Want to build ['python3', 'kivy', 'openssl']
[INFO    ] Using the bundled version for recipe 'python3'
[INFO    ] Loaded recipe python3 (depends of ['hostpython3', 'libffi', 'openssl'], optional are [])
[INFO    ] Using the bundled version for recipe 'kivy'
[INFO    ] Loaded recipe kivy (depends of ['sdl2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'ios', 'pyobjus', 'python', 'host_setuptools3'], optional are [])
[INFO    ] Using the bundled version for recipe 'openssl'
[INFO    ] Loaded recipe openssl (depends of [], optional are [])
[INFO    ] Using the bundled version for recipe 'hostpython3'
[INFO    ] Loaded recipe hostpython3 (depends of ['hostopenssl'], optional are [])
[INFO    ] Using the bundled version for recipe 'libffi'
[INFO    ] Loaded recipe libffi (depends of [], optional are [])
[INFO    ] Using the bundled version for recipe 'sdl2'
[INFO    ] Loaded recipe sdl2 (depends of [], optional are [])
[INFO    ] Using the bundled version for recipe 'sdl2_image'
[INFO    ] Loaded recipe sdl2_image (depends of ['sdl2'], optional are [])
[INFO    ] Using the bundled version for recipe 'sdl2_mixer'
[INFO    ] Loaded recipe sdl2_mixer (depends of ['sdl2'], optional are [])
[INFO    ] Using the bundled version for recipe 'sdl2_ttf'
[INFO    ] Loaded recipe sdl2_ttf (depends of ['sdl2', 'freetype'], optional are [])
[INFO    ] Using the bundled version for recipe 'ios'
[INFO    ] Loaded recipe ios (depends of ['python'], optional are [])
[INFO    ] Using the bundled version for recipe 'pyobjus'
[INFO    ] Loaded recipe pyobjus (depends of ['python'], optional are [])
[INFO    ] Using the bundled version for recipe 'python'
[INFO    ] Loaded recipe python (depends of ['python3'], optional are [])
[INFO    ] Using the bundled version for recipe 'host_setuptools3'
[INFO    ] Loaded recipe host_setuptools3 (depends of ['openssl', 'hostpython3', 'python3'], optional are [])
[INFO    ] Using the bundled version for recipe 'hostopenssl'
[INFO    ] Loaded recipe hostopenssl (depends of [], optional are [])
[INFO    ] Using the bundled version for recipe 'freetype'
[INFO    ] Loaded recipe freetype (depends of [], optional are [])
[INFO    ] Build order is ['freetype', 'hostopenssl', 'libffi', 'openssl', 'sdl2', 'hostpython3', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3', 'host_setuptools3', 'python', 'ios', 'pyobjus', 'kivy']
[INFO    ] Using the bundled version for recipe 'freetype'
[INFO    ] Using the bundled version for recipe 'hostopenssl'
[INFO    ] Using the bundled version for recipe 'libffi'
[INFO    ] Using the bundled version for recipe 'openssl'
[INFO    ] Using the bundled version for recipe 'sdl2'
[INFO    ] Using the bundled version for recipe 'hostpython3'
[INFO    ] Using the bundled version for recipe 'sdl2_image'
[INFO    ] Using the bundled version for recipe 'sdl2_mixer'
[INFO    ] Using the bundled version for recipe 'sdl2_ttf'
[INFO    ] Using the bundled version for recipe 'python3'
[INFO    ] Using the bundled version for recipe 'host_setuptools3'
[INFO    ] Using the bundled version for recipe 'python'
[INFO    ] Using the bundled version for recipe 'ios'
[INFO    ] Using the bundled version for recipe 'pyobjus'
[INFO    ] Using the bundled version for recipe 'kivy'
[INFO    ] Recipe order is ['freetype', 'hostopenssl', 'libffi', 'openssl', 'sdl2', 'hostpython3', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python3', 'host_setuptools3', 'ios', 'pyobjus', 'kivy']
[INFO    ] Include dir added: {arch.arch}/freetype
[INFO    ] Include dir added: {arch.arch}/ffi
[INFO    ] Include dir added: {arch.arch}/openssl
[INFO    ] Include dir added: common/sdl2
[INFO    ] Global: hostpython located at /Users/fma/Desktop/IOSSFB/dist/hostpython3/bin/python
[INFO    ] Global: hostpgen located at /Users/fma/Desktop/IOSSFB/dist/hostpython3/bin/pgen
[INFO    ] Include dir added: common/sdl2_image
[INFO    ] Include dir added: common/sdl2_mixer
[INFO    ] Include dir added: common/sdl2_ttf
[DEBUG   ] Cached result: Download freetype. Ignoring
[DEBUG   ] Cached result: Extract freetype. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites freetype. Ignoring
[DEBUG   ] Cached result: Build_all freetype. Ignoring
[DEBUG   ] Cached result: Download hostopenssl. Ignoring
[DEBUG   ] Cached result: Extract hostopenssl. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites hostopenssl. Ignoring
[DEBUG   ] Cached result: Build_all hostopenssl. Ignoring
[DEBUG   ] Cached result: Download libffi. Ignoring
[DEBUG   ] Cached result: Extract libffi. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites libffi. Ignoring
[DEBUG   ] Cached result: Build_all libffi. Ignoring
[DEBUG   ] Cached result: Download openssl. Ignoring
[DEBUG   ] Cached result: Extract openssl. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites openssl. Ignoring
[DEBUG   ] Cached result: Build_all openssl. Ignoring
[DEBUG   ] Cached result: Download sdl2. Ignoring
[DEBUG   ] Cached result: Extract sdl2. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites sdl2. Ignoring
[DEBUG   ] Cached result: Build_all sdl2. Ignoring
[DEBUG   ] Cached result: Download hostpython3. Ignoring
[DEBUG   ] Cached result: Extract hostpython3. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites hostpython3. Ignoring
[DEBUG   ] Cached result: Build_all hostpython3. Ignoring
[DEBUG   ] Cached result: Download sdl2_image. Ignoring
[DEBUG   ] Cached result: Extract sdl2_image. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites sdl2_image. Ignoring
[DEBUG   ] Cached result: Build_all sdl2_image. Ignoring
[DEBUG   ] Cached result: Download sdl2_mixer. Ignoring
[DEBUG   ] Cached result: Extract sdl2_mixer. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites sdl2_mixer. Ignoring
[DEBUG   ] Cached result: Build_all sdl2_mixer. Ignoring
[DEBUG   ] Cached result: Download sdl2_ttf. Ignoring
[DEBUG   ] Cached result: Extract sdl2_ttf. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites sdl2_ttf. Ignoring
[DEBUG   ] Cached result: Build_all sdl2_ttf. Ignoring
[DEBUG   ] Cached result: Download python3. Ignoring
[DEBUG   ] Cached result: Extract python3. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites python3. Ignoring
[DEBUG   ] Cached result: Build_all python3. Ignoring
[DEBUG   ] Cached result: Download host_setuptools3. Ignoring
[DEBUG   ] Cached result: Extract host_setuptools3. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites host_setuptools3. Ignoring
[DEBUG   ] Cached result: Build_all host_setuptools3. Ignoring
[DEBUG   ] Cached result: Download ios. Ignoring
[DEBUG   ] Cached result: Extract ios. Ignoring
[DEBUG   ] Cached result: Install_hostpython_prerequisites ios. Ignoring
[INFO    ] Build_all ios
[INFO    ] Build ios for x86_64, arm64 (filtered)
[INFO    ] Build ios
[WARNING ] ios build for x86_64 has been incomplete
[WARNING ] Warning: deleting the build and restarting.
[INFO    ] Prebuild ios for x86_64
[DEBUG   ] Invoking prebuild_x86_64
[INFO    ] Build ios for x86_64
[INFO    ] CC and CXX will not use ccache
[INFO    ] Cythonize ios.pyx
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.10/bin/toolchain", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 1555, in main
    ToolchainCL()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 1299, in __init__
    getattr(self, args.command)()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 1368, in build
    build_recipes(args.recipe, ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 1142, in build_recipes
    recipe.execute()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 704, in execute
    self.build_all()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 74, in _cache_execution
    f(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 803, in build_all
    self.build(arch)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 74, in _cache_execution
    f(self, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 790, in build
    self.build_arch(arch)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 1094, in build_arch
    self.cythonize_build()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 1067, in cythonize_build
    self.cythonize_file(join(root, filename))
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/kivy_ios/toolchain.py", line 1059, in cythonize_file
    shprint(sh.python, cythonize_script, filename)
  File "/Users/fma/Library/Python/3.10/lib/python/site-packages/sh.py", line 3548, in __getattr__
    return self.__env[name]
  File "/Users/fma/Library/Python/3.10/lib/python/site-packages/sh.py", line 3330, in __getitem__
    raise CommandNotFound(k)
sh.CommandNotFound: python
misl6 commented 1 year ago

Hi @FMA93 !

I'm sorry for the late reply, but I'm trying to catch out on everything I left unresponded from the last week. 😄

The issue you're reporting has already got fixed via #745 . As we don't have a release after that fix got merged into master, you'll need to install the development version: https://github.com/kivy/kivy-ios#development