Skip to content

When calling /opt/venv/bin/myscript PATH is not properly defined #351

@ikus060

Description

@ikus060

Using dh-virtualenv to install a packages, command line entrypoint are properly created into the virtual env as /opt/venv/bin/myscript. For a user, it's possible to call then directly. But when doing so, the executable get started without the appropriate modification of PATH and PYTHONHOME. This can cause a problem for some project that expect to call executable. Someone would expect the executable to be loaded from the same virtualenv. But since PATH is not properly define to use the virtualenv, either the executable is not found or the wrong version is loaded from the operating system.

Expected behaviour.
In addition to shebang update, I would expect dh-virtualenv to update the script to define the PATH.

I would recommand replacing the shebang by something similar to

env PATH=/opt/venv/bin:$PATH python

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