Deutsch English Français Italiano |
<mailman.15.1744880295.3008.python-list@python.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!fu-berlin.de!uni-berlin.de!not-for-mail From: Roel Schroeven <roel@roelschroeven.net> Newsgroups: comp.lang.python Subject: Re: Pip installs to unexpected place Date: Thu, 17 Apr 2025 10:58:09 +0200 Lines: 37 Message-ID: <mailman.15.1744880295.3008.python-list@python.org> References: <CAApdmf2J69WgkR159sBSkxN0=mYoNmHZYboBmpPi+LdA-YBNpg@mail.gmail.com> <CAN06=CxPNLHtr_sdgphR2jrN1V+WbB8wZDJdbvfEDb-MYtmPHA@mail.gmail.com> <818a0fcd-72c8-4fbb-8ee4-4553f4f88f75@wichmann.us> <d9dd903b-856c-470d-b7ce-1f4ad8b49adc@roelschroeven.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de es3sQt37kNSba0hKePaBCg8bFWFZ4KaAdFbD3sV9dgBw== Cancel-Lock: sha1:fOhb1SFvTUnq0j5H/3y60/s0wRU= sha256:IZGa3fa5YpOtI3UAAwWj0g0yhtdICaoKP/Xgsw32wXw= Return-Path: <roel@roelschroeven.net> X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org Authentication-Results: mail.python.org; dkim=pass reason="2048-bit key; unprotected key" header.d=roelschroeven.net header.i=@roelschroeven.net header.b=O2CWCatJ; dkim-adsp=pass; dkim-atps=neutral X-Spam-Status: OK 0.046 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'pip': 0.04; 'bin': 0.09; 'pip.': 0.09; 'theory': 0.09; '"there': 0.16; 'mats': 0.16; 'packages,': 0.16; 'pip,': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:internal': 0.16; 'received:messagingengine.com': 0.16; 'restaurant': 0.16; 'schreef': 0.16; 'virtualenv': 0.16; 'wichmann': 0.16; 'python': 0.16; "can't": 0.17; 'to:addr:python-list': 0.20; 'install': 0.23; 'command': 0.23; 'installed': 0.23; 'run': 0.23; '(and': 0.25; 'saying': 0.25; 'anyone': 0.25; 'visual': 0.26; 'settings': 0.28; 'example,': 0.28; 'it,': 0.29; 'header:User-Agent:1': 0.30; 'here,': 0.32; 'there': 0.33; 'path': 0.33; 'header:In-Reply- To:1': 0.34; 'running': 0.35; 'those': 0.36; "it's": 0.37; 'directory': 0.37; 'way': 0.38; 'means': 0.38; 'use': 0.39; "that's": 0.39; 'prompt': 0.39; 'something': 0.40; 'in,': 0.60; 'including': 0.60; 'here.': 0.61; 'gives': 0.62; 'ever': 0.63; 'everything': 0.63; 'your': 0.64; 'named': 0.65; 'exactly': 0.68; 'figures': 0.69; 'latter': 0.69; 'skip:/ 30': 0.69; 'depending': 0.70; 'finds': 0.76; 'states': 0.80; 'activate': 0.91; 'received:103': 0.91; 'former': 0.93; 'instantly': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= roelschroeven.net; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm1; t=1744880291; x=1744966691; bh=joYRfZKabWn7G110z4esV DJsURUFZPWeEy1/Zo+E6vM=; b=O2CWCatJDv3yNqqxp50e20YPSFBWP/qSITCYm UdPOsg6H82s6KHpNWrOCS9PYB707g27p7Drg/ChP3tCwl0fob2nIxloUuS6VmtYy G+3nwKgQwoLJkwZoJC3VWxynZnEshnAicaYL5GTgTsE1Sz2+mGvubaA7EUlBnLWz kpL3Fgj+VUABbNj3spOKxyzMCCyRO4AKrgMQSCYa1e1WnZfIph8KPW6cz9AtGn7d WBMIcEAQGGuhCLnqnRFMFQkkUoMrHtqnAoddFs3zyHzYnWLUlKTZ9asYUGMln4LD A0vXKKoOObfpItQAPbUY8pRIyptoX44dPLjsIgBTTqzlPCApQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1744880291; x=1744966691; bh=j oYRfZKabWn7G110z4esVDJsURUFZPWeEy1/Zo+E6vM=; b=LAKIjVwUeVcVLqaHN fvcrB+VPeV4IO50rboa8XnSmvjWvdG4DVl82C7brFFfzFwGIXdG7FmtZI9UySdxB mCp/p5JdbuzxjaIlk+/Ur4NuWRyssyGKkDGxP4NFScpoSB+tcOYP3uXFVVBE0s6u Lc66HhLqZSKCCFWl6Nm1/8ePrkErlteV8kJEMt/01YWJf6LD27dmm+CjN1/BfgzA EynhEDzM7rkHqycqQJa0GC6RTOurba1wyg/Q+FCB56PgnR1wxZlwQOmEgV81jAv/ x8mh95joCBgKr5aZ6A84BogAQhIMYIA8Uy3tIAItVdFCrjzMGF2CEyW2PXzeg9Pj xn+QQ== X-ME-Sender: <xms:osIAaDE6RO8dZAO3bXAmaYftGm8QrlEbJ3fkF2sJsmqUUcSumGW9_g> <xme:osIAaAXpdpegsu7ecqMz1fnv6NQDAShksZPkORfWsZl-kMTCTXwOcMBIfIuM8o4bx 4_iW4aj9Mc8> X-ME-Received: <xmr:osIAaFIN-HBxzOAYRhAk3Js7kk_bRlSURppj0b__KgwZegkc5Ijx6Fg1wclUY7CztHt39ozFzJf3zXFIUC6_Av5t2pDF704> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdekkeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeftohgvlhcuufgthhhrohgv vhgvnhcuoehrohgvlhesrhhovghlshgthhhrohgvvhgvnhdrnhgvtheqnecuggftrfgrth htvghrnhepgeejffekgedvveejjefhgedtvdehhfeihfelfefhgfeitddvieegieeigedv udfhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprh hovghlsehrohgvlhhstghhrhhovghvvghnrdhnvghtpdhnsggprhgtphhtthhopedupdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehphihthhhonhdqlhhishhtsehphihthh honhdrohhrgh X-ME-Proxy: <xmx:o8IAaBHEEJ4B5gzBiR_T2t_9c2xBkWaf3Eb0ebdm0BOZWlwewoeGFw> <xmx:o8IAaJWFOhc1Ov_QLR23h9u8ggjTjHfIQO1zSZv5pqWfV5-e6UeKaw> <xmx:o8IAaMNaMVQc8JvIM5-FM8HHnejod9Nm5aagwIaCchVR7IIn4XOO6w> <xmx:o8IAaI1o8GjS1Hmu8AYMlZLVef3bOCJB-sgNzeEsasSI0jzeem3dIA> <xmx:o8IAaIG-sMvloXa60Zq2wgJRYHf1Zr60xCYSuOxUS5XZPwqRBWL-v-FB> Feedback-ID: i8e5b41ae:Fastmail User-Agent: Mozilla Thunderbird Content-Language: nl In-Reply-To: <818a0fcd-72c8-4fbb-8ee4-4553f4f88f75@wichmann.us> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: General discussion list for the Python programming language <python-list.python.org> List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> List-Archive: <https://mail.python.org/pipermail/python-list/> List-Post: <mailto:python-list@python.org> List-Help: <mailto:python-list-request@python.org?subject=help> List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> X-Mailman-Original-Message-ID: <d9dd903b-856c-470d-b7ce-1f4ad8b49adc@roelschroeven.net> X-Mailman-Original-References: <CAApdmf2J69WgkR159sBSkxN0=mYoNmHZYboBmpPi+LdA-YBNpg@mail.gmail.com> <CAN06=CxPNLHtr_sdgphR2jrN1V+WbB8wZDJdbvfEDb-MYtmPHA@mail.gmail.com> <818a0fcd-72c8-4fbb-8ee4-4553f4f88f75@wichmann.us> Bytes: 8298 Op 15/04/2025 om 20:31 schreef Mats Wichmann via Python-list: > To be clear: you do not have to activate a virtualenv to use *Python* > from it. If you just call the python by the path it's in, it figures > everything out (and sets some variables you can query vi sysconfig if > you have reason to actually need those details (look for installation > schemes). > > What activating gives you is some path fiddling, and some prompt > fiddling (although the prompt fiddling keeps saying it's deprecated). > The latter is a visual clue; the former means you can also find > *other* commands installed in the virtualenv - including pip. > > /path/to/virtualenv//bin/python -m pip install ... will work whether > you activated or not. > > pip install ... finds the first command in your PATH named pip, which > may or may not be the one in the virtualenv, *unless* you've activated > it, because that's the only way the virtualenv bin directory ends up > early in your path. And the pip command that is found and run will use it's own settings regarding where to install packages, even if you activated a virtualenv. For example, you can't use /usr/bin/pip to install something in a virtualenv. To install something in a virtualenv, you need to use the pip in that virtualenv (either by first activating that venv, or by running something like venv/bin/pip, or venv). (Of course to do that pip needs to be installed in that venv. That might or might not be the case depending on how the venv was created.) I kinda get the feeling that something like that is going on here. -- "There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable. There is another theory which states that this has already happened." -- Douglas Adams, The Restaurant at the End of the Universe