Skip to content

Installation issue: python #37171

@awadell1

Description

@awadell1

Steps to reproduce the issue

$ spack spec -I python@3.10.10+zlib
Input spec
--------------------------------
 -   python@3.10.10+zlib

Concretized
--------------------------------
[+]  python@3.10.10%gcc@7.5.0+bz2+crypt+ctypes+dbm~debug+libxml2+lzma~nis~optimizations+pic+pyexpat+pythoncmd+readline
+shared+sqlite3+ssl~tkinter+uuid+zlib build_system=generic patches=0d98e93,7d40923,f2fd060 arch=linux-opensuse15-zen
[+]      ^bzip2@1.0.8%gcc@7.5.0~debug~pic+shared build_system=generic arch=linux-opensuse15-zen
[+]          ^diffutils@3.9%gcc@7.5.0 build_system=autotools arch=linux-opensuse15-zen
[+]      ^expat@2.5.0%gcc@7.5.0+libbsd build_system=autotools arch=linux-opensuse15-zen
[+]          ^libbsd@0.11.7%gcc@7.5.0 build_system=autotools arch=linux-opensuse15-zen
[+]              ^libmd@1.0.4%gcc@7.5.0 build_system=autotools arch=linux-opensuse15-zen
[+]      ^gdbm@1.23%gcc@7.5.0 build_system=autotools arch=linux-opensuse15-zen
[+]      ^gettext@0.21.1%gcc@7.5.0+bzip2+curses+git~libunistring+libxml2+tar+xz build_system=autotools arch=linux-open
suse15-zen
[+]          ^libiconv@1.17%gcc@7.5.0 build_system=autotools libs=shared,static arch=linux-opensuse15-zen
[+]          ^libxml2@2.10.3%gcc@7.5.0~python build_system=autotools arch=linux-opensuse15-zen
[+]          ^tar@1.34%gcc@7.5.0 build_system=autotools zip=pigz arch=linux-opensuse15-zen
[+]              ^pigz@2.7%gcc@7.5.0 build_system=makefile arch=linux-opensuse15-zen
[+]              ^zstd@1.5.5%gcc@7.5.0+programs build_system=makefile compression=none libs=shared,static arch=linux-o
pensuse15-zen
[+]      ^libffi@3.4.4%gcc@7.5.0 build_system=autotools arch=linux-opensuse15-zen
[+]      ^libxcrypt@4.4.33%gcc@7.5.0~obsolete_api build_system=autotools arch=linux-opensuse15-zen
[+]          ^perl@5.36.0%gcc@7.5.0+cpanm+open+shared+threads build_system=generic arch=linux-opensuse15-zen
[+]              ^berkeley-db@18.1.40%gcc@7.5.0+cxx~docs+stl build_system=autotools patches=26090f4,b231fcc arch=linux
-opensuse15-zen
[+]      ^ncurses@6.4%gcc@7.5.0~symlinks+termlib abi=none build_system=autotools arch=linux-opensuse15-zen
[+]      ^openssl@1.1.1t%gcc@7.5.0~docs~shared build_system=generic certs=mozilla arch=linux-opensuse15-zen
[+]          ^ca-certificates-mozilla@2023-01-10%gcc@7.5.0 build_system=generic arch=linux-opensuse15-zen
[+]      ^pkgconf@1.8.0%gcc@7.5.0 build_system=autotools arch=linux-opensuse15-zen
[+]      ^readline@8.2%gcc@7.5.0 build_system=autotools patches=bbf97f1 arch=linux-opensuse15-zen
[+]      ^sqlite@3.40.1%gcc@7.5.0+column_metadata+dynamic_extensions+fts~functions+rtree build_system=autotools arch=l
inux-opensuse15-zen
[+]      ^util-linux-uuid@2.38.1%gcc@7.5.0 build_system=autotools arch=linux-opensuse15-zen
[+]      ^xz@5.4.1%gcc@7.5.0~pic build_system=autotools libs=shared,static arch=linux-opensuse15-zen
[+]      ^zlib@1.2.13%gcc@7.5.0+optimize+pic+shared build_system=makefile arch=linux-opensuse15-zen

$ spack install --overwrite -y python@3.10.10

Error message

Instance of python installed by spack cannot import the zlib module

Error message
```console
❯ spack load python@3.10.10

❯ which python3
/home/awadell/spack/opt/spack/linux-opensuse15-zen/gcc-7.5.0/python-3.10.10-xplxbc5o5jrloglj35wngefohj7tt6ze/bin/python3

❯ python3 -c "import zlib"
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'zlib'

❯ PYTHONHOME=~/spack/opt/spack/linux-opensuse15-zen/gcc-7.5.0/python-3.10.10-xplxbc5o5jrloglj35wngefohj7tt6ze/ python3 -c "import zlib"
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'zlib'
```

Information on your system

❯ spack debug report

  • Spack: 0.20.0.dev0 (c76023d)
  • Python: 3.6.13
  • Platform: linux-opensuse15-zen3
  • Concretizer: clingo

Additional information

spack-build-out.txt
spack-build-env.txt
spack-configure-args.txt
spack-build-01-configure-out.txt

@adamjstewart @pradyunsg @scheibelp @skosukhin

Staged Version works

Installing with spack and keeping the stage, results in a usable instance, but the installed version lack's zlib:

spack install --overwrite --keep-stage python@3.10.10+zlib
...spack cd python@3.10.10+zlib./python
Python 3.10.10 (main, Apr 24 2023, 19:39:34) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import zlib
>>> 

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have run spack maintainers <name-of-the-package> and @mentioned any maintainers
  • I have uploaded the build log and environment files
  • I have searched the issues of this repo and believe this is not a duplicate

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions