GNU bug report logs -
#53258
Python unable to find modules within a Singularity container created with guix pack
Previous Next
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
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
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.