镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Allow to pass python file path as a parameter #35

Open

Description

@agentcooper

const PYTHON_BRIDGE_SCRIPT = path.join(__dirname, 'node_python_bridge.py');

Most Electron apps pack files into the ASAR archive, so there is no access to node_modules. During build it is possible to copy some resources outside of the ASAR bundle to be accessed later.

Would you accept a PR to provide a custom path to node_python_bridge.py?

Activity

  1. munro commented on Jul 10, 2021

    @munro
    Member

    Ahhh, I see. Yes, send it this way!

    I'm thinking there's probably some spec in package.json that allows us to add files as dependencies that I'm sure Electron picks up, perhaps files [0] ?

    [0] https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files

  2. agentcooper commented on Jul 13, 2021

    @agentcooper
    Author

    @munro I've sent a PR.

    AFAIK there is nothing in Electron itself for this, however in one of the popular builders you need to specify those files manually.

  3. agentcooper commented on Jul 28, 2021

    @agentcooper
    Author

    Until the PR is landed, I am using this hack to make it work with ASAR: electron/electron#9459 (comment) together with following electron-builder config:

    {
      "asarUnpack": ["node_modules/python-bridge"]
    }
  4. rkeshs commented on Dec 26, 2021

    @rkeshs

    I am getting a weird error. Does it have any relation with this issue?
    errno: -2, code: 'ENOENT', syscall: 'spawn python', path: 'python', spawnargs: [ 'path_to/node_python_bridge.py' ]

  5. rkeshs commented on Dec 26, 2021

    @rkeshs

    I found what causing this error, It's just the wrong symlink in my linux system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions