AirtestProject / AirtestProject/Poco

python3.7运行AndroidUiautomationPoco,报错:ImportError: sys.meta_path is None, Python is likely shutting down

Offen
#431 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
2k
Forks
341
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

运行代码如下:
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
aa = poco("android:id/switch_widget")
print(aa.attr("checked"))

在IDE(1.2.5)中用自带的python(应该是3.5吧)运行,正常
换成本地python3.7
可以运行,但最后报错(报错不影响运行):
Exception ignored in:
Traceback (most recent call last):
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/hrpc/object_proxy.py", line 114, in __del__
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/hrpc/client.py", line 63, in evaluate
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/hrpc/transport/http.py", line 23, in send
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/requests/api.py", line 119, in post

File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/requests/api.py", line 61, in request
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/requests/sessions.py", line 521, in request
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/requests/sessions.py", line 699, in merge_environment_settings
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/requests/utils.py", line 766, in get_environ_proxies
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/site-packages/requests/utils.py", line 750, in should_bypass_proxies
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/urllib/request.py", line 2645, in proxy_bypass
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/urllib/request.py", line 2622, in proxy_bypass_macosx_sysconf
File "/Users/szh/opt/miniconda3/envs/python37/lib/python3.7/urllib/request.py", line 2569, in _proxy_bypass_macosx_sysconf
ImportError: sys.meta_path is None, Python is likely shutting down

--------------------------------
但如果调整运行代码为:
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
poco("android:id/switch_widget")
print(poco("android:id/switch_widget").attr("checked"))

即,不把poco实例赋值给变量,python3.5,3.7都运行正常,不报错

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.