-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding AssetFinder subdirectories to sys.path
causes extract_packages
error
#820
Comments
See also #754 (comment). |
I'm attempting to use https://github.com/learningequality/kolibri, which vendors a whole bunch of stuff in its wheel and updates |
Please post the full stack trace of your error, and I'll take a look at it. |
Here's the stack trace:
What's happening in the python function is that it's trying to import This may sound insane (and I mostly agree), but it does work on android as the wheel bundles native libraries for all the android platforms. We're currently building our app with pythonforandroid and it works in that sense. The problem you're describing above where a directory in |
OK, I'll see if I can fix this in the next Chaquopy version. Related: #917 |
When creating a non-root AssetFinder, copy the parent's `extract_packages` so that importing bare modules works correctly. This is typically needed when packages are vendored and `sys.path` is dynamically updated to prefer the vendored version. Fixes: chaquo#820
From #818:
The problem is in the following code:
Because of the
"." not in mod_name
check,extract_dir
will only be called on a finder which is directly onsys.path
. Normally this would mean its path is directly belowAssetFinder
, which are the only finders that currently have anextract_packages
attribute. However, force_pydevd.py uses a context manager to temporarily add a subdirectory to sys.path, so it can import a vendored package without using a prefix.We should be able to support this use case. We may be able to fix it simply by copying
extract_packages
from the parent finder, or somehow ensuring thatextract_dir
is called on the root finder.The text was updated successfully, but these errors were encountered: