Skip to content
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

OxidizedFinder not found on sys.meta_path[0] #602

Closed
kwsmith1 opened this issue Jul 5, 2022 · 3 comments
Closed

OxidizedFinder not found on sys.meta_path[0] #602

kwsmith1 opened this issue Jul 5, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@kwsmith1
Copy link

kwsmith1 commented Jul 5, 2022

I'm new to this library and running into a problem. I've created a build but when I try to run a Python script through my embedded interpreter I'm getting this message:

error instantiating embedded Python interpreter: OxidizedFinder not found on sys.meta_path[0] (this should never happen)

I've searched around but can't find a straightforward answer anywhere. The 'this should never happen' part is especially discouraging.

Anyone have an idea how to move past this error?

@indygreg indygreg added the need-info More information is needed in order to proceed label Jul 12, 2022
@indygreg
Copy link
Owner

Do you have steps to reproduce?

I want to say this is reproducible by writing custom Rust code. But looking at the interpreter initialization code in pyembed, it is difficult for me to see how this error could occur. Although there is a TODO in remove_external_importers() that may be the source of this.

@kwsmith1
Copy link
Author

I cannot reproduce in another environment; I tried on two separate machines, which both worked just fine.
I did not write any custom Rust code.

I'm not sure how to debug at this point.

@indygreg indygreg added the bug Something isn't working label Aug 22, 2022
@indygreg
Copy link
Owner

This can be caused by a .pth file in site-packages installing its own meta path importer. And in recent months modern versions of setuptools employ such a trick. We'll need to shore up the sys.meta_path code to be more tolerant of additional meta path importers.

A short term workaround is to disable the import of the site module at interpreter initialization time. e.g. site_import = False in Starlark. https://gregoryszorc.com/docs/pyoxidizer/0.22.0/pyoxidizer_config_type_python_interpreter_config.html#starlark_pyoxidizer.PythonInterpreterConfig.site_import

@indygreg indygreg removed the need-info More information is needed in order to proceed label Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants