GNU bug report logs - #53258
Python unable to find modules within a Singularity container created with guix pack

Previous Next

Package: guix;

Reported by: Marek Felšöci <marek <at> felsoci.sk>

Date: Fri, 14 Jan 2022 16:08:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#53258: closed (Python unable to find modules within a
 Singularity container created with guix pack)
Date: Sun, 21 Jan 2024 18:32:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 21 Jan 2024 13:31:18 -0500
with message-id <87r0ia8rnt.fsf <at> gmail.com>
and subject line Re: bug#53258: Python unable to find modules within a Singularity container created with guix pack
has caused the debbugs.gnu.org bug report #53258,
regarding Python unable to find modules within a Singularity container created with guix pack
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
53258: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53258
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Marek Felšöci <marek <at> felsoci.sk>
To: bug-guix <at> gnu.org
Subject: Python unable to find modules within a Singularity container created
 with guix pack
Date: Fri, 14 Jan 2022 15:20:46 +0100
Hello folks,

Recently, I have come around this issue. I created a Singularity container using 
the following `guix pack` command:

`guix pack -f squashfs bash coreutils python python-numpy`

Then, I run a bash shell within the container:

`singularity exec test.gz.squashfs bash`

Now, if I want to use numpy,

`python3 -m numpy`

it gives me the following error and the numpy module IS NOT found:

Error in sitecustomize; set PYTHONVERBOSE for traceback:
ValueError: 
'/gnu/store/2dyd6rlcc9m68k3mvkw86k8dygkbg025-profile/bin/../../p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/site-packages' 
is not in list
/gnu/store/2dyd6rlcc9m68k3mvkw86k8dygkbg025-profile/bin/python3: No module named 
numpy

However, if I do,

`export PYTHONPATH=$GUIX_PYTHONPATH`

the numpy module IS found:

Error in sitecustomize; set PYTHONVERBOSE for traceback:
ValueError: 
'/gnu/store/2dyd6rlcc9m68k3mvkw86k8dygkbg025-profile/bin/../../p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/site-packages' 
is not in list
/gnu/store/2dyd6rlcc9m68k3mvkw86k8dygkbg025-profile/bin/python3: No module named 
numpy.__main__; 'numpy' is a package and cannot be directly executed

Still, the sitecustomize error persists.

See the output of `guix describe` below (only the guix channel):

Pokolenie 3    14. január 2022 14:33:06    (súčasné)
  guix 5c5d9e5
    zdroj repozitára: https://git.savannah.gnu.org/git/guix.git
    vetva: master
    úprava: 5c5d9e5a3208fa51351c6ad8267eba3d96fa2232

Thanks,

Marek



[Message part 3 (message/rfc822, inline)]
From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Konrad Hinsen <konrad.hinsen <at> fastmail.net>
Cc: 53258-done <at> debbugs.gnu.org
Subject: Re: bug#53258: Python unable to find modules within a Singularity
 container created with guix pack
Date: Sun, 21 Jan 2024 13:31:18 -0500
Hi Konrad,

Konrad Hinsen <konrad.hinsen <at> fastmail.net> writes:

> Konrad Hinsen <konrad.hinsen <at> fastmail.net> writes:
>
>> Patch at https://issues.guix.gnu.org/68241
>
> If you want to test it without rebuilding tons of packages, here is a
> version that grafts a patched Python onto the existing ones (as substitutes):
>
> https://codeberg.org/khinsen/guix/src/branch/graft-fix-python-sitecustomize

I've applied your patch to core-updates.  I trust that it fixed this
issue based on your own testing.

Closing; we can always reopen if we find it didn't fix every use cases
or create a fresh issue.

-- 
Thanks,
Maxim


This bug report was last modified 1 year and 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.