kivy / kivy-ios

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

toolchain pip3 uninstall <package> fails #699

Open RobertFlatt opened 2 years ago

RobertFlatt commented 2 years ago

Versions

Describe the bug toolchain pip3 uninstall fails

At the confirm prompt "Proceed (Y/n)?" the tool does not pause, it crashes.

To Reproduce

toolchain pip3 install toolchain pip3 list toolchain pip3 uninstall

Logs

bert@Air ex % toolchain pip3 list
[INFO    ] Using the bundled version for recipe 'freetype'
[INFO    ] Include dir added: {arch.arch}/freetype
[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/robert/Documents/ex/dist/hostpython3/bin/python
[INFO    ] Global: hostpgen located at /Users/robert/Documents/ex/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: ['list']
[INFO    ] Running Shell: /Users/robert/Documents/ex/dist/hostpython3/bin/pip3 ('list',) {'_env': {'CC': '/bin/false', 'CXX': '/bin/false', 'PYTHONPATH': '/Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages', 'PYTHONOPTIMIZE': '2'}, '_iter': True, '_out_bufsize': 1, '_err_to_out': True}
[DEBUG   ] Package       Version
[DEBUG   ] ------------- ----------
[DEBUG   ] camera4kivy   0.0.6
[DEBUG   ] certifi       2021.10.8
[DEBUG   ] gestures4kivy 0.0.7
[DEBUG   ] ios           1.1
[DEBUG   ] Kivy          2.2.0.dev0
[DEBUG   ] pip           21.2.4
[DEBUG   ] pyobjus       1.2.2.dev0
[DEBUG   ] setuptools    58.1.0
[DEBUG   ] WARNING: You are using pip version 21.2.4; however, version 22.0.4 is available.
[DEBUG   ] You should consider upgrading via the '/Users/robert/Documents/ex/dist/hostpython3/bin/python3.9 -m pip install --upgrade pip' command.
robert@Air ex % 

robert@Air ex % toolchain pip3 uninstall camera4kivy
[INFO    ] Using the bundled version for recipe 'freetype'
[INFO    ] Include dir added: {arch.arch}/freetype
[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/robert/Documents/ex/dist/hostpython3/bin/python
[INFO    ] Global: hostpgen located at /Users/robert/Documents/ex/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: ['uninstall', 'camera4kivy']
[INFO    ] Running Shell: /Users/robert/Documents/ex/dist/hostpython3/bin/pip3 ('uninstall', 'camera4kivy') {'_env': {'CC': '/bin/false', 'CXX': '/bin/false', 'PYTHONPATH': '/Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages', 'PYTHONOPTIMIZE': '2'}, '_iter': True, '_out_bufsize': 1, '_err_to_out': True}
[DEBUG   ] Found existing installation: camera4kivy 0.0.6
[DEBUG   ] Uninstalling camera4kivy-0.0.6:
[DEBUG   ]   Would remove:
[DEBUG   ]     /Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages/camera4kivy-0.0.6.dist-info/*
[DEBUG   ]     /Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages/camera4kivy/*
[DEBUG   ] Proceed (Y/n)? ERROR: Exception:
[DEBUG   ] Traceback (most recent call last):
[DEBUG   ]   File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
[DEBUG   ]     status = self.run(options, args)
[DEBUG   ]   File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py", line 93, in run
[DEBUG   ]     uninstall_pathset = req.uninstall(
[DEBUG   ]   File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 633, in uninstall
[DEBUG   ]     uninstalled_pathset.remove(auto_confirm, verbose)
[DEBUG   ]   File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 378, in remove
[DEBUG   ]     if auto_confirm or self._allowed_to_proceed(verbose):
[DEBUG   ]   File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/req/req_uninstall.py", line 419, in _allowed_to_proceed
[DEBUG   ]     return ask('Proceed (Y/n)? ', ('y', 'n', '')) != 'n'
[DEBUG   ]   File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 203, in ask
[DEBUG   ]     response = input(message)
[DEBUG   ] EOFError: EOF when reading a line
Exception in thread background thread for pid 83572:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 1683, in wrap
    fn(*rgs, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 2662, in background_thread
    handle_exit_code(exit_code)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 2349, in fn
    return self.command.handle_command_exit_code(exit_code)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /Users/robert/Documents/ex/dist/hostpython3/bin/pip3 uninstall camera4kivy

  STDOUT:
Found existing installation: camera4kivy 0.0.6
Uninstalling camera4kivy-0.0.6:
  Would remove:
    /Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages/camera4kivy-0.0.6.dist-info/*
    /Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages/camera4kivy/*
Proceed (Y/n)? ERROR: Exception:
Traceback (most recent call last):
  File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py", line 93, in run
    uninstall_pathset = req.uninstall(
  File "/Users/robert/Documents/ex/dist... (750 more, please see e.stdout)

  STDERR:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/toolchain", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1555, in main
    ToolchainCL()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1299, in __init__
    getattr(self, args.command)()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1511, in pip3
    self.pip()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1514, in pip
    _pip(sys.argv[2:])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 1186, in _pip
    shprint(pip_cmd, *args, _env=pip_env)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/kivy_ios/toolchain.py", line 56, in shprint
    for line in cmd:
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 953, in next
    self.wait()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 879, in wait
    self.handle_command_exit_code(exit_code)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/sh.py", line 905, in handle_command_exit_code
    raise exc
sh.ErrorReturnCode_2: 

  RAN: /Users/robert/Documents/ex/dist/hostpython3/bin/pip3 uninstall camera4kivy

  STDOUT:
Found existing installation: camera4kivy 0.0.6
Uninstalling camera4kivy-0.0.6:
  Would remove:
    /Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages/camera4kivy-0.0.6.dist-info/*
    /Users/robert/Documents/ex/dist/root/python3/lib/python3.9/site-packages/camera4kivy/*
Proceed (Y/n)? ERROR: Exception:
Traceback (most recent call last):
  File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/Users/robert/Documents/ex/dist/hostpython3/lib/python3.9/site-packages/pip/_internal/commands/uninstall.py", line 93, in run
    uninstall_pathset = req.uninstall(
  File "/Users/robert/Documents/ex/dist... (750 more, please see e.stdout)

  STDERR:

robert@Air ex % 

Screenshots

Additional context Add any other context about the problem here.

pakal commented 1 year ago

Note: although it's just a temporary workaround, adding "--yes" to the "pip uninstall" command does the job to avoid stdin prompt