Re: pip installing scripts into another virtualenv

Chris Jerdonek <[email protected]>
Newsgroups gmane.comp.python.distutils.devel
Message-ID <CAOTb1wfGHS_GvSiy2JPYh2g2P+GWptTGhto4zfYz_4wzFraikQ@mail.gmail.com>
Isn't virtualenv's default behavior to install pip automatically when
a virtualenv is created?
https://virtualenv.pypa.io/en/stable/userguide/#usage
(That is, I don't think you need to "force" pip to be installed, but
rather simply rely on default behavior.)

--Chris


On Fri, Sep 14, 2018 at 12:50 AM, Alex Becker <[email protected]> wrote:
> The main downside to invoking pip in the virtualenv is that it means I have
> to have pip installed within the virtualenv, which is something I haven't
> wanted to commit to in the interest of creating slim virtualenvs for
> bundling with apps. But you are probably right and I need to accept that.
>
> On Fri, Sep 14, 2018 at 12:43 AM Chris Jerdonek <[email protected]>
> wrote:
>>
>> Yes, why not simply invoke the pip installed in the virtualenv into
>> which you want to install the packages? It doesn't seem like you'd
>> need to "re-architect" anything insomuch as simply change "pip" in
>> your argument list to the path to the pip inside the virtualenv you're
>> targeting.
>>
>> --Chris
>>
>> On Fri, Sep 14, 2018 at 12:15 AM, Alex Becker <[email protected]>
>> wrote:
>> > As part of a package management tool, I'm trying to use pip to install
>> > python packages into a virtualenv, from python code (via subprocess),
>> > into a
>> > different virtualenv than the virtualenv my python process is running in
>> > (if
>> > any). I have this *mostly* working with:
>> >
>> > pip install --prefix [virtualenv-path] --ignore-installed
>> > --no-build-isolation
>> >
>> > However, installed scripts break because the scrips automatically get
>> > prepended with a shebang pointing to the python interpreter pip was run
>> > under.
>> >
>> > Is there a way around this behavior? Am I crazy to even try to install
>> > into
>> > a different virtualenv? Or do I have to re-architect my code to call pip
>> > in
>> > the target virtualenv (which may require me forcing pip to be installed,
>> > depending on what versions of python I choose to support)?
>> >
>> > Sincerely,
>> >
>> > Alex Becker
>> >
>> > --
>> > Distutils-SIG mailing list -- [email protected]
>> > To unsubscribe send an email to [email protected]
>> > https://mail.python.org/mm3/mailman3/lists/distutils-sig.python.org/
>> > Message archived at
>> >
>> > https://mail.python.org/mm3/archives/list/[email protected]/message/C5Y2KKW2YQGFE74LZXQLXE32RJOABVEE/
>> >
--
Distutils-SIG mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mm3/mailman3/lists/distutils-sig.python.org/
Message archived at https://mail.python.org/mm3/archives/list/[email protected]/message/BYOFB67MQHKCGIK3XKR7DUHO4PED67NB/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.