Skip to content

Running in a secondary virtualenv fails #97

@mattip

Description

@mattip

Try this:

  • create a venv and install pkg-config into it, then run pkgconf, all is good.

    $ python3.13 -m venv /tmp/venv_with_pkg_config
    $ source /tmp/venv_with_pkg_config/bin/activate
    $ pip install pkgconf
    $ deactivate
    $ /tmp/venv_with_pkg_config/bin/pkgconf --version
    # prints 2.5.1 and debug stuff to stderr
    
  • Now create another venv, and try to call pkgconf with an absolute path. It fails.

    $ python3.13 -m venv /tmp/venv2
    $ source /tmp/venv2/bin/activate
    $ /tmp/venv_with_pkg_config/bin/pkgconf --version
    # it errors!!!
    
  • Unset $VIRTUAL_ENV, it will run again

    $ unset VIRTUAL_ENV
    $ /tmp/venv_with_pkg_config/bin/pkgconf --version
    # prints 2.5.1 and debug stuff to stderr
    

This is intentional.
However it breaks using the package as a true replacement for pkg-config, since the utility is meant to be called inside an isolated virtual environment in pip install or cibuildwheel. See numpy/numpy#26574.

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