You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To the problem with .pth files on Android: When processing the .pth file I get the following error before the main module is even started. On windows executing the startup code via .pth is no problem. I guess that java.chaquopy.import_override modifies some behavior, so that _socket is not loaded when executing my startup code.
...
W/python.stderr: Error processing line 1 of /data/data/com.example.helloworld/files/chaquopy/AssetFinder/app/__briefcase_startup__.pth:
W/python.stderr:
W/python.stderr: Traceback (most recent call last):
W/python.stderr: File "<frozen site>", line 206, in addpackage
W/python.stderr: File "<string>", line 1, in <module>
W/python.stderr: File "import.pxi", line 60, in java.chaquopy.import_override
W/python.stderr: File "/data/data/com.example.helloworld/files/chaquopy/AssetFinder/app/__briefcase_startup__.py", line 4, in <module>
W/python.stderr: import socket
W/python.stderr: File "stdlib/socket.py", line 52, in <module>
W/python.stderr: ModuleNotFoundError: No module named '_socket'
W/python.stderr:
W/python.stderr: Remainder of file ignored
D/MainActivity: Running main module helloworld
...
The text was updated successfully, but these errors were encountered:
sys.path correctly follows the dependency order (app, requirements, stdlib). However, initialization should happen in the reverse order, low level to high level. And in case .pth files scan the whole of sys.path, we should create all path entries before running any .pth files.
So the order should be:
Add all sys.path entries, without running any code from those paths.
Run site.addsitedir in the order (stdlib, requirements, app)
mhsmith
changed the title
site.addsitedir order is incorrectsite.addsitedir order is incorrect
Mar 3, 2025
Originally reported by @timrid in beeware/briefcase#2173 (comment)
To the problem with .pth files on Android: When processing the .pth file I get the following error before the main module is even started. On windows executing the startup code via .pth is no problem. I guess that
java.chaquopy.import_override
modifies some behavior, so that_socket
is not loaded when executing my startup code.The text was updated successfully, but these errors were encountered: