mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-19 23:33:33 +08:00
Dep: Show help message when getting ModuleNotFoundError: No module named 'progress.bar'
This commit is contained in:
@@ -5,6 +5,17 @@ from deploy.emulator import EmulatorConnect
|
|||||||
from deploy.utils import *
|
from deploy.utils import *
|
||||||
|
|
||||||
|
|
||||||
|
def show_fix_tip(module):
|
||||||
|
print(f"""
|
||||||
|
To fix this:
|
||||||
|
1. Open console.bat
|
||||||
|
2. Execute the following commands:
|
||||||
|
pip uninstall -y {module}
|
||||||
|
pip install --no-cache-dir {module}
|
||||||
|
3. Re-open Alas.exe
|
||||||
|
""")
|
||||||
|
|
||||||
|
|
||||||
class AdbManager(DeployConfig):
|
class AdbManager(DeployConfig):
|
||||||
@cached_property
|
@cached_property
|
||||||
def adb(self):
|
def adb(self):
|
||||||
@@ -26,14 +37,13 @@ class AdbManager(DeployConfig):
|
|||||||
try:
|
try:
|
||||||
import adbutils
|
import adbutils
|
||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
# ModuleNotFoundError: No module named 'apkutils2'
|
message = str(e)
|
||||||
print(e)
|
for module in ['apkutils2', 'progress']:
|
||||||
print('Please open console.bat, execute the following commands and re-open Alas.exe')
|
# ModuleNotFoundError: No module named 'apkutils2'
|
||||||
print()
|
# ModuleNotFoundError: No module named 'progress.bar'
|
||||||
print(' pip uninstall -y apkutils2')
|
if module in message:
|
||||||
print(' pip install --no-cache-dir apkutils2')
|
show_fix_tip(module)
|
||||||
print()
|
exit(1)
|
||||||
exit(1)
|
|
||||||
from uiautomator2.init import Initer
|
from uiautomator2.init import Initer
|
||||||
for device in adbutils.adb.iter_device():
|
for device in adbutils.adb.iter_device():
|
||||||
init = Initer(device, loglevel=logging.DEBUG)
|
init = Initer(device, loglevel=logging.DEBUG)
|
||||||
|
|||||||
Reference in New Issue
Block a user