unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Konrad Hinsen <konrad.hinsen@fastmail.net>
To: 53258@debbugs.gnu.org
Subject: bug#53258: Python unable to find modules within a Singularity container created with guix pack
Date: Thu, 04 Jan 2024 13:35:28 +0100	[thread overview]
Message-ID: <m1v889jmy7.fsf@fastmail.net> (raw)
In-Reply-To: <67e7d225-f824-b691-7125-6b37abef8bb0@felsoci.sk>

Hi everyone,

I found this issue while investigating a related one (the error
message). It looks like the core problem discussed here has been solved
in the meantime:

   Singularity> python3 -m numpy
   Error in sitecustomize; set PYTHONVERBOSE for traceback:
   ValueError: '/gnu/store/kx98dz2vc3gdpjficy4nbd7rscnkvz4s-profile/bin/../../h855kddqbay0pcbwr8a7i8m6ilz67cfn-python-3.10.7/lib/python3.10/site-packages' is not in list
   /gnu/store/kx98dz2vc3gdpjficy4nbd7rscnkvz4s-profile/bin/python3: No module named numpy.__main__; 'numpy' is a package and cannot be directly executed

This error message is to be expected, and NumPy can be imported:

   Singularity> python3
   Error in sitecustomize; set PYTHONVERBOSE for traceback:
   ValueError: '/gnu/store/kx98dz2vc3gdpjficy4nbd7rscnkvz4s-profile/bin/../../h855kddqbay0pcbwr8a7i8m6ilz67cfn-python-3.10.7/lib/python3.10/site-packages' is not in list
   Python 3.10.7 (main, Jan  1 1970, 00:00:01) [GCC 11.3.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import numpy
   >>> 

What remains is the error message, which comes from a bug in Guix'
sitecustomize.py. It compares a raw path (sys.prefix) with paths that
have been normalized (os.path.normpath). That comparison fails if
sys.prefix contains "../", as it does when run from a Singularity
container. I will submit a patch for this.

Cheers,
  Konrad




  parent reply	other threads:[~2024-01-04 12:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 14:20 bug#53258: Python unable to find modules within a Singularity container created with guix pack Marek Felšöci
2022-01-14 17:45 ` Ludovic Courtès
2022-02-04 20:50   ` Ludovic Courtès
2022-02-05 22:28     ` Josselin Poiret via Bug reports for GNU Guix
2022-02-05 22:30       ` Josselin Poiret via Bug reports for GNU Guix
2022-03-07  8:25       ` Ludovic Courtès
2023-02-02 14:44         ` Josselin Poiret via Bug reports for GNU Guix
2023-02-02 15:40           ` Maxim Cournoyer
2023-02-06 17:34             ` Simon Tournier
2024-01-04 12:35 ` Konrad Hinsen [this message]
2024-01-04 13:01   ` Konrad Hinsen
2024-01-05 15:23     ` Konrad Hinsen
2024-01-21 18:31       ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1v889jmy7.fsf@fastmail.net \
    --to=konrad.hinsen@fastmail.net \
    --cc=53258@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).