Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Embedded interpreters: No way to extendsys.path #128352

Open
@smurfix

Description

@smurfix

Feature or enhancement

Proposal:

Setting up an embedded Python interpreter often involves augmentingsys.path with some application-specific subdirectories, so as not to pollute the system's normal Python installation.

Unfortunately,PyConfig only affords either replacing the default path wholesale, or leaving it as-is (viamodule_search_paths_set). There appears to be no way to augmentsys.path with application-specific directories and no documented way to retrieve the default contents ofsys.path.

A workable solution might be to enhancecfg.module_search_paths_set so that when it's set to 2 or 3, the application's paths shall be prepended / appended tosys.path instead of replacing it.

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

https://discuss.python.org/t/embedding-how-do-i-extend-sys-path/75734

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp