Skip to content

pip.bat doesn't install to venv #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mirober opened this issue Sep 20, 2020 · 2 comments
Closed

pip.bat doesn't install to venv #145

mirober opened this issue Sep 20, 2020 · 2 comments
Labels

Comments

@mirober
Copy link

mirober commented Sep 20, 2020

Normal behaviour of virtualenv is to create new versions of a lot of the Python code in Scripts/ (https://www.python.org/dev/peps/pep-0405/#creating-virtual-environments), including the executable.

the code in cpython that looks for venvs is this:

    executable = sys.executable
    exe_dir, _ = os.path.split(os.path.abspath(executable))
    site_prefix = os.path.dirname(exe_dir)
    sys._home = None
    conf_basename = 'pyvenv.cfg'
    candidate_confs = [
        conffile for conffile in (
            os.path.join(exe_dir, conf_basename),
            os.path.join(site_prefix, conf_basename)
            )
        if os.path.isfile(conffile)
        ]

I tried doing the same thing using pip.bat as a template and it couldn't find it - pip.bat calls .python/python.exe, which resolves to Program files/talon/python.exe, then python looks for the pyvenv.cfg in Program Files/talon and Program Files and doesn't find it

@lunixbochs lunixbochs transferred this issue from talonvoice/beta Nov 2, 2020
@lunixbochs lunixbochs added the bug label Nov 2, 2020
@lunixbochs
Copy link

Ok, my idea is kind of dirty, but I think I can fix this:

  1. use the start flag to NOT import site -S
  2. set sys.executable in my pip.bat shim to the venv
  3. import site

@lunixbochs
Copy link

Should be fixed in latest beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants