From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kI2qKB4yLGB/CwAA0tVLHw (envelope-from ) for ; Tue, 16 Feb 2021 20:59:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wEJlJB4yLGBDKwAAbx9fmQ (envelope-from ) for ; Tue, 16 Feb 2021 20:59:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EDE582DFE9 for ; Tue, 16 Feb 2021 21:59:09 +0100 (CET) Received: from localhost ([::1]:47358 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lC7R7-0007W6-68 for larch@yhetil.org; Tue, 16 Feb 2021 15:59:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43070) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC7R0-0007Vu-Hm for bug-guix@gnu.org; Tue, 16 Feb 2021 15:59:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lC7R0-0000YU-AP for bug-guix@gnu.org; Tue, 16 Feb 2021 15:59:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lC7R0-0006HA-AH for bug-guix@gnu.org; Tue, 16 Feb 2021 15:59:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#46569: python can't find internal pip modules in environment from manifest Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 16 Feb 2021 20:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46569 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 46569@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161350911324087 (code B ref -1); Tue, 16 Feb 2021 20:59:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Feb 2021 20:58:33 +0000 Received: from localhost ([127.0.0.1]:41767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC7QS-0006GK-4s for submit@debbugs.gnu.org; Tue, 16 Feb 2021 15:58:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:47906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC7QQ-0006GC-1H for submit@debbugs.gnu.org; Tue, 16 Feb 2021 15:58:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC7QP-000734-OZ for bug-guix@gnu.org; Tue, 16 Feb 2021 15:58:25 -0500 Received: from mail1.fsfe.org ([217.69.89.151]:56620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lC7QN-0000UB-QO for bug-guix@gnu.org; Tue, 16 Feb 2021 15:58:25 -0500 From: Jelle Licht Date: Tue, 16 Feb 2021 21:58:20 +0100 Message-ID: <86czwz7ms3.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.69.89.151; envelope-from=jlicht@fsfe.org; helo=mail1.fsfe.org X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.26 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=fsfe.org (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: EDE582DFE9 X-Spam-Score: -2.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: B6qrJvQtL7k2 Python can not load all pip-related python modules when loaded from a manifest file, yet seems to work fine when loaded 'directly' as part of a `guix environment'-invocation. Provided that we have a file in `hi.py': --8<---------------cut here---------------start------------->8--- import pip print("halfwaypoint") import pip._internal.index.package_finder print("I made it!") --8<---------------cut here---------------end--------------->8--- and a `manifest.scm' with: --8<---------------cut here---------------start------------->8--- (use-modules (gnu) (guix packages) (gnu packages python) (gnu packages python-xyz)) (packages->manifest (list python python-pip)) --8<---------------cut here---------------end--------------->8--- I can get the expected output by running: `guix environment --pure --ad-hoc python python-pip -- python3 hi.py' => > halfwaypoint > I made it! Yet, when I run the following: `guix environment --pure -m manifest.scm -- python3 hi.py' => --8<---------------cut here---------------start------------->8--- halfwaypoint Traceback (most recent call last): File "hi.py", line 4, in import pip._internal.index.package_finder File "/gnu/store/4m5vhlq61qnj36rq60l83xcmgj3mx92j-profile/lib/python3.8/site-packages/pip/_internal/__init__.py", line 40, in from pip._internal.cli.autocompletion import autocomplete File "/gnu/store/4m5vhlq61qnj36rq60l83xcmgj3mx92j-profile/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 8, in from pip._internal.cli.main_parser import create_main_parser File "/gnu/store/4m5vhlq61qnj36rq60l83xcmgj3mx92j-profile/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 11, in from pip._internal.commands import ( File "/gnu/store/4m5vhlq61qnj36rq60l83xcmgj3mx92j-profile/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 6, in from pip._internal.commands.completion import CompletionCommand File "/gnu/store/4m5vhlq61qnj36rq60l83xcmgj3mx92j-profile/lib/python3.8/site-packages/pip/_internal/commands/completion.py", line 6, in from pip._internal.cli.base_command import Command File "/gnu/store/4m5vhlq61qnj36rq60l83xcmgj3mx92j-profile/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 26, in from pip._internal.index import PackageFinder ImportError: cannot import name 'PackageFinder' from 'pip._internal.index' (/gnu/store/4m5vhlq61qnj36rq60l83xcmgj3mx92j-profile/lib/python3.8/site-packages/pip/_internal/index/__init__.py) --8<---------------cut here---------------end--------------->8--- Why is there a difference in the first place? Shouldn't both approaches work? - Jelle