Added notice for common 'apt_pkg not found' error in Ubuntu 18

This commit is contained in:
Eric Froemling 2020-05-04 16:57:28 -07:00
parent c442063c30
commit c038b13fde

View File

@ -135,8 +135,17 @@ class ServerManagerApp:
# left in limbo with our process thread still running.
pass
except BaseException as exc:
print(f'{Clr.SRED}Unexpected interpreter exception:'
f' {exc}{Clr.RST}')
# Installing Python 3.7 on Ubuntu 18 can lead to this error;
# inform the user how to fix it.
if "No module named 'apt_pkg'" in str(exc):
print(f'{Clr.SRED}Error: Your Python environment needs to'
' be fixed (apt_pkg cannot be found).\n'
f'See the final step in the Linux instructions here:\n'
f' https://github.com/efroemling/ballistica/'
f'wiki/Getting-Started#linux{Clr.RST}')
else:
print(f'{Clr.SRED}Unexpected interpreter exception:'
f' {exc} ({type(exc)}){Clr.RST}')
# Mark ourselves as shutting down and wait for the process to wrap up.
self._done = True