Skip to content

__PYVENV_LAUNCHER__ being set creates unexpected problems for child Python instances #3576

@daisylb

Description

@daisylb

xonfig

Details
❯ xonfig
+------------------+---------------------+
| xonsh            | 0.9.18              |
| Git SHA          | 26475146            |
| Commit Date      | May 5 06:42:28 2020 |
| Python           | 3.8.2               |
| PLY              | 3.11                |
| have readline    | True                |
| prompt toolkit   | 3.0.5               |
| shell type       | prompt_toolkit      |
| pygments         | None                |
| on posix         | True                |
| on linux         | False               |
| on darwin        | True                |
| on windows       | False               |
| on cygwin        | False               |
| on msys2         | False               |
| is superuser     | False               |
| default encoding | utf-8               |
| xonsh encoding   | utf-8               |
| encoding errors  | surrogateescape     |
+------------------+---------------------+

Expected Behavior

When I run python -m venv from within Xonsh, the virtualenv created should be based on the Python I'm invoking, not the Python that Xonsh is running in.

Current Behavior

The virtualenv created is based on the Python that Xonsh is running in.

If I put del $__PYENV_LAUNCHER__ in my .xonshrc, everything works as expected.

I think this may also be the cause of issues I've been having getting Pyenv to compile Python, but I've yet to test this.

Steps to Reproduce

  1. Install Xonsh using pipx, (under, say, Python 3.8).
  2. Install a different Python version (say, Python 3.7).
  3. Use python -m venv to make a virtualenv with the latter.

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