FileNotFoundError: [Errno 2] No such file or directory: b'/Users/<myname>/Desktop/kivy/kivy-ios/dist/hostpython3/bin/pip3' ( kivy app )

69 views
Skip to first unread message

Gordon

unread,
Nov 29, 2022, 7:41:42 AM11/29/22
to Kivy users support

Since I got this error when building project in Xcode,

ModuleNotFoundError: No module named 'requests'

and then I'm trying to install the requests module with git command.

python toolchain.py pip install requests

However, I read the logs and I got this FileNotFoundError message. How can I deal with the error?


'''

[INFO    ] Using the bundled version for recipe 'host_setuptools3'

[INFO    ] Using the bundled version for recipe 'hostopenssl'

[INFO    ] Using the bundled version for recipe 'hostpython3'

[INFO    ] Global: hostpython located at /Users/<myname>/Desktop/kivy/kivy-ios/dist/hostpython3/bin/python

[INFO    ] Global: hostpgen located at /Users/<myname>/Desktop/kivy/kivy-ios/dist/hostpython3/bin/pgen

[INFO    ] Using the bundled version for recipe 'ios'

[INFO    ] Using the bundled version for recipe 'kivy'

[INFO    ] Using the bundled version for recipe 'libffi'

[INFO    ] Include dir added: {arch.arch}/ffi

[INFO    ] Using the bundled version for recipe 'openssl'

[INFO    ] Include dir added: {arch.arch}/openssl

[INFO    ] Using the bundled version for recipe 'pyobjus'

[INFO    ] Using the bundled version for recipe 'python3'

[INFO    ] Using the bundled version for recipe 'sdl2'

[INFO    ] Include dir added: common/sdl2

[INFO    ] Using the bundled version for recipe 'sdl2_image'

[INFO    ] Include dir added: common/sdl2_image

[INFO    ] Using the bundled version for recipe 'sdl2_mixer'

[INFO    ] Include dir added: common/sdl2_mixer

[INFO    ] Using the bundled version for recipe 'sdl2_ttf'

[INFO    ] Include dir added: common/sdl2_ttf

[INFO    ] Executing pip with: ['install', '--isolated', '--prefix', '/Users/<myname>/Desktop/kivy/kivy-ios/dist/root/python3', 'requests']

[INFO    ] Running Shell: /Users/<myname>/Desktop/kivy/kivy-ios/dist/hostpython3/bin/pip3 ('install', '--isolated', '--prefix', '/Users/<myname>/Desktop/kivy/kivy-ios/dist/root/python3', 'requests') {'_env': {'CC': '/bin/false', 'CXX': '/bin/false', 'PYTHONPATH': '/Users/<myname>/Desktop/kivy/kivy-ios/dist/root/python3/lib/python3.9/site-packages', 'PYTHONOPTIMIZE': '2'}, '_iter': True, '_out_bufsize': 1, '_err_to_out': True}

Traceback (most recent call last):

  File "/Users/<myname>/Desktop/kivy/kivy-ios/toolchain.py", line 3, in <module>

    main()

  File "/Users/<myname>/Desktop/kivy/kivy-ios/kivy_ios/toolchain.py", line 1555, in main

    ToolchainCL()

  File "/Users/<myname>/Desktop/kivy/kivy-ios/kivy_ios/toolchain.py", line 1299, in __init__

    getattr(self, args.command)()

  File "/Users/<myname>/Desktop/kivy/kivy-ios/kivy_ios/toolchain.py", line 1514, in pip

    _pip(sys.argv[2:])

  File "/Users/<myname>/Desktop/kivy/kivy-ios/kivy_ios/toolchain.py", line 1186, in _pip

    shprint(pip_cmd, *args, _env=pip_env)

  File "/Users/<myname>/Desktop/kivy/kivy-ios/kivy_ios/toolchain.py", line 55, in shprint

    cmd = command(*args, **kwargs)

  File "/Users/<myname>/Desktop/kivy/kivy-ios/<myEnv>/lib/python3.9/site-packages/sh.py", line 1524, in __call__

    return RunningCommand(cmd, call_args, stdin, stdout, stderr)

  File "/Users/<myname>/Desktop/kivy/kivy-ios/<myEnv>/lib/python3.9/site-packages/sh.py", line 780, in __init__

    self.process = OProc(self, self.log, cmd, stdin, stdout, stderr,

  File "/Users/<myname>/Desktop/kivy/kivy-ios/<myEnv>/lib/python3.9/site-packages/sh.py", line 2125, in __init__

    raise ForkException(fork_exc)

sh.ForkException: 


Original exception:

===================


    Traceback (most recent call last):

      File "/Users/<myname>/Desktop/kivy/kivy-ios/<myEnv>/lib/python3.9/site-packages/sh.py", line 2080, in __init__

        os.execve(cmd[0], cmd, ca["env"])

    FileNotFoundError: [Errno 2] No such file or directory: b'/Users/<myname>/Desktop/kivy/kivy-ios/dist/hostpython3/bin/pip3'

'''


So I looked the file "/Users//Desktop/kivy/kivy-ios/dist/hostpython3/bin/pip3" and the virtual environment file "/Users//Desktop/kivy/kivy-ios//lib/python3.9/site-packages/sh.py" to see whether they are existed. And both of them are really existed! I'm so confuse with this error. So please help me out here! It is the finally step for me to run my first app soon! Thanks!

Robert

unread,
Nov 29, 2022, 12:10:53 PM11/29/22
to Kivy users support
Not a lot of kivy-ios experience here, I suggest you try Discord https://discord.gg/HxGPRPHT
Message has been deleted

Gordon

unread,
Dec 4, 2022, 7:40:59 AM12/4/22
to Kivy users support
I have tried many ways to solve the issue in the last few days but failed. Finally, an admin in the kivy discord helps me solve the issue.

In my case, maybe I used the command `sudo toolchain.py build python kivy`. However, sudo is bad, and maybe what caused this issue.

After I clean up the build and reinstall all kivy using `toolchain.py build python kivy`, I finally solve the issue. Thank you for the help from the admin and kivy community!
Reply all
Reply to author
Forward
0 new messages