python-poetry / poetry

Python packaging and dependency management made easy
https://python-poetry.org
MIT License
31.12k stars 2.25k forks source link

project / package installation error with deactivated virtualenvironments #9190

Closed pascal456 closed 4 weeks ago

pascal456 commented 6 months ago

Description

Installing (local) package / project with poetry fails when attempting to containerize my app (tbh just a single script).

Installation on dev machine runs fine. From here I copy the necessary files into the container:

# Essentials
WORKDIR /app
COPY ./<myppackagefolder> ./<myppackagefolder>
COPY setup.cfg .
COPY pyproject.toml .
COPY poetry.lock .
COPY README.md .

Workarounds

The only way to get the installation process working is to omit

RUN poetry config virtualenvs.create false

But this is not a solution since I would then have to activate the venv inside the running container, but that would not make much sense. Also the instructions in poetry docs basically describe this scenario for containers.

Poetry Installation Method

pip

Operating System

official python container image (python:3.11-slim-bookworm)

Poetry Version

1.8.2

Poetry Configuration

sorry cannot provide since the build is not successful, have no chance to attach to the full contianer.

From an intermediate container I get the following result:

root@7f39fe90b99f:/app# poetry config --list
cache-dir = "/root/.cache/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = false
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /root/.cache/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

Also from the intermediate container:

```bash session root@7f39fe90b99f:/app# python -m sysconfig Platform: "linux-x86_64" Python version: "3.11" Current installation scheme: "posix_prefix" Paths: data = "/usr/local" include = "/usr/local/include/python3.11" platinclude = "/usr/local/include/python3.11" platlib = "/usr/local/lib/python3.11/site-packages" platstdlib = "/usr/local/lib/python3.11" purelib = "/usr/local/lib/python3.11/site-packages" scripts = "/usr/local/bin" stdlib = "/usr/local/lib/python3.11" Variables: ABIFLAGS = "" AC_APPLE_UNIVERSAL_BUILD = "0" AIX_BUILDDATE = "0" AIX_GENUINE_CPLUSPLUS = "0" ALIGNOF_LONG = "8" ALIGNOF_SIZE_T = "8" ALT_SOABI = "0" ANDROID_API_LEVEL = "0" AR = "ar" ARFLAGS = "rcs" BASECFLAGS = "-Wsign-compare" BASECPPFLAGS = "" BASEMODLIBS = "" BINDIR = "/usr/local/bin" BINLIBDEST = "/usr/local/lib/python3.11" BLDLIBRARY = "-L. -lpython3.11" BLDSHARED = "gcc -shared" BOOTSTRAP_HEADERS = "\" BUILDEXE = "" BUILDPYTHON = "python" BUILD_GNU_TYPE = "x86_64-pc-linux-gnu" BYTESTR_DEPS = "\" CC = "gcc" CCSHARED = "-fPIC" CFLAGS = "-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall" CFLAGSFORSHARED = "-fPIC" CFLAGS_ALIASING = "" CONFIGFILES = "configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in" CONFIGURE_CFLAGS = "" CONFIGURE_CFLAGS_NODIST = "-fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden" CONFIGURE_CPPFLAGS = "" CONFIGURE_LDFLAGS = "" CONFIGURE_LDFLAGS_NODIST = "-fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g" CONFIGURE_LDFLAGS_NOLTO = "-fno-lto" CONFIG_ARGS = "'--build=x86_64-linux-gnu' '--enable-loadable-sqlite-extensions' '--enable-optimizations' '--enable-option-checking=fatal' '--enable-shared' '--with-lto' '--with-system-expat' '--without-ensurepip' 'build_alias=x86_64-linux-gnu'" CONFINCLUDEDIR = "/usr/local/include" CONFINCLUDEPY = "/usr/local/include/python3.11" COREPYTHONPATH = "" COVERAGE_INFO = "/usr/src/python/coverage.info" COVERAGE_LCOV_OPTIONS = "--rc lcov_branch_coverage=1" COVERAGE_REPORT = "/usr/src/python/lcov-report" COVERAGE_REPORT_OPTIONS = "--rc lcov_branch_coverage=1 --branch-coverage --title "CPython 3.11 LCOV report [commit $(shell )]"" CPPFLAGS = "-I. -I./Include" CXX = "g++" DECIMAL_CFLAGS = "-I./Modules/_decimal/libmpdec -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1" DECIMAL_LDFLAGS = "-lm Modules/_decimal/libmpdec/libmpdec.a" DEEPFREEZE_C = "Python/deepfreeze/deepfreeze.c" DEEPFREEZE_DEPS = "./Tools/scripts/deepfreeze.py _bootstrap_python ./Programs/_freeze_module.py \" DEEPFREEZE_OBJS = "Python/deepfreeze/deepfreeze.o" DESTDIRS = "/usr/local /usr/local/lib /usr/local/lib/python3.11 /usr/local/lib/python3.11/lib-dynload" DESTLIB = "/usr/local/lib/python3.11" DESTPATH = "" DESTSHARED = "/usr/local/lib/python3.11/lib-dynload" DFLAGS = "" DIRMODE = "755" DIST = "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummy" DISTDIRS = "Include Lib Misc Ext-dummy" DISTFILES = "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in" DLINCLDIR = "." DLLLIBRARY = "" DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 = "0" DOUBLE_IS_BIG_ENDIAN_IEEE754 = "0" DOUBLE_IS_LITTLE_ENDIAN_IEEE754 = "1" DTRACE = "" DTRACE_DEPS = "\" DTRACE_HEADERS = "" DTRACE_OBJS = "" DYNLOADFILE = "dynload_shlib.o" ENABLE_IPV6 = "1" ENSUREPIP = "no" EXE = "" EXEMODE = "755" EXPAT_CFLAGS = "" EXPAT_LDFLAGS = "-lexpat" EXPORTSFROM = "" EXPORTSYMS = "" EXTRATESTOPTS = "" EXTRA_CFLAGS = "" EXT_SUFFIX = ".cpython-311-x86_64-linux-gnu.so" FILEMODE = "644" FLOAT_WORDS_BIGENDIAN = "0" FREEZE_MODULE = "./_bootstrap_python ./Programs/_freeze_module.py" FREEZE_MODULE_BOOTSTRAP = "./Programs/_freeze_module" FREEZE_MODULE_BOOTSTRAP_DEPS = "Programs/_freeze_module" FREEZE_MODULE_DEPS = "_bootstrap_python ./Programs/_freeze_module.py" FROZEN_FILES_IN = "\" FROZEN_FILES_OUT = "\" GETPGRP_HAVE_ARG = "0" GITBRANCH = "" GITTAG = "" GITVERSION = "" GNULD = "yes" HAVE_ACCEPT = "1" HAVE_ACCEPT4 = "1" HAVE_ACOSH = "1" HAVE_ADDRINFO = "1" HAVE_ALARM = "1" HAVE_ALIGNED_REQUIRED = "0" HAVE_ALLOCA_H = "1" HAVE_ALTZONE = "0" HAVE_ASINH = "1" HAVE_ASM_TYPES_H = "1" HAVE_ATANH = "1" HAVE_BIND = "1" HAVE_BIND_TEXTDOMAIN_CODESET = "1" HAVE_BLUETOOTH_BLUETOOTH_H = "1" HAVE_BLUETOOTH_H = "0" HAVE_BROKEN_MBSTOWCS = "0" HAVE_BROKEN_NICE = "0" HAVE_BROKEN_PIPE_BUF = "0" HAVE_BROKEN_POLL = "0" HAVE_BROKEN_POSIX_SEMAPHORES = "0" HAVE_BROKEN_PTHREAD_SIGMASK = "0" HAVE_BROKEN_SEM_GETVALUE = "0" HAVE_BROKEN_UNSETENV = "0" HAVE_BUILTIN_ATOMIC = "1" HAVE_BZLIB_H = "1" HAVE_CHFLAGS = "0" HAVE_CHMOD = "1" HAVE_CHOWN = "1" HAVE_CHROOT = "1" HAVE_CLOCK = "1" HAVE_CLOCK_GETRES = "1" HAVE_CLOCK_GETTIME = "1" HAVE_CLOCK_NANOSLEEP = "1" HAVE_CLOCK_SETTIME = "1" HAVE_CLOSE_RANGE = "1" HAVE_COMPUTED_GOTOS = "1" HAVE_CONFSTR = "1" HAVE_CONIO_H = "0" HAVE_CONNECT = "1" HAVE_COPY_FILE_RANGE = "1" HAVE_CRYPT_H = "1" HAVE_CRYPT_R = "1" HAVE_CTERMID = "1" HAVE_CTERMID_R = "0" HAVE_CURSES_FILTER = "1" HAVE_CURSES_H = "1" HAVE_CURSES_HAS_KEY = "1" HAVE_CURSES_IMMEDOK = "1" HAVE_CURSES_IS_PAD = "1" HAVE_CURSES_IS_TERM_RESIZED = "1" HAVE_CURSES_RESIZETERM = "1" HAVE_CURSES_RESIZE_TERM = "1" HAVE_CURSES_SYNCOK = "1" HAVE_CURSES_TYPEAHEAD = "1" HAVE_CURSES_USE_ENV = "1" HAVE_CURSES_WCHGAT = "1" HAVE_DB_H = "1" HAVE_DECL_RTLD_DEEPBIND = "1" HAVE_DECL_RTLD_GLOBAL = "1" HAVE_DECL_RTLD_LAZY = "1" HAVE_DECL_RTLD_LOCAL = "1" HAVE_DECL_RTLD_MEMBER = "0" HAVE_DECL_RTLD_NODELETE = "1" HAVE_DECL_RTLD_NOLOAD = "1" HAVE_DECL_RTLD_NOW = "1" HAVE_DECL_TZNAME = "0" HAVE_DEVICE_MACROS = "1" HAVE_DEV_PTC = "0" HAVE_DEV_PTMX = "1" HAVE_DIRECT_H = "0" HAVE_DIRENT_D_TYPE = "1" HAVE_DIRENT_H = "1" HAVE_DIRFD = "1" HAVE_DLFCN_H = "1" HAVE_DLOPEN = "1" HAVE_DUP = "1" HAVE_DUP2 = "1" HAVE_DUP3 = "1" HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH = "0" HAVE_DYNAMIC_LOADING = "1" HAVE_ENDIAN_H = "1" HAVE_EPOLL = "1" HAVE_EPOLL_CREATE1 = "1" HAVE_ERF = "1" HAVE_ERFC = "1" HAVE_ERRNO_H = "1" HAVE_EVENTFD = "1" HAVE_EXECV = "1" HAVE_EXPLICIT_BZERO = "1" HAVE_EXPLICIT_MEMSET = "0" HAVE_EXPM1 = "1" HAVE_FACCESSAT = "1" HAVE_FCHDIR = "1" HAVE_FCHMOD = "1" HAVE_FCHMODAT = "1" HAVE_FCHOWN = "1" HAVE_FCHOWNAT = "1" HAVE_FCNTL_H = "1" HAVE_FDATASYNC = "1" HAVE_FDOPENDIR = "1" HAVE_FDWALK = "0" HAVE_FEXECVE = "1" HAVE_FLOCK = "1" HAVE_FORK = "1" HAVE_FORK1 = "0" HAVE_FORKPTY = "1" HAVE_FPATHCONF = "1" HAVE_FSEEK64 = "0" HAVE_FSEEKO = "1" HAVE_FSTATAT = "1" HAVE_FSTATVFS = "1" HAVE_FSYNC = "1" HAVE_FTELL64 = "0" HAVE_FTELLO = "1" HAVE_FTIME = "1" HAVE_FTRUNCATE = "1" HAVE_FUTIMENS = "1" HAVE_FUTIMES = "1" HAVE_FUTIMESAT = "1" HAVE_GAI_STRERROR = "1" HAVE_GCC_ASM_FOR_MC68881 = "0" HAVE_GCC_ASM_FOR_X64 = "1" HAVE_GCC_ASM_FOR_X87 = "1" HAVE_GCC_UINT128_T = "1" HAVE_GDBM_DASH_NDBM_H = "0" HAVE_GDBM_H = "1" HAVE_GDBM_NDBM_H = "0" HAVE_GETADDRINFO = "1" HAVE_GETC_UNLOCKED = "1" HAVE_GETEGID = "1" HAVE_GETENTROPY = "1" HAVE_GETEUID = "1" HAVE_GETGID = "1" HAVE_GETGRGID = "1" HAVE_GETGRGID_R = "1" HAVE_GETGRNAM_R = "1" HAVE_GETGROUPLIST = "1" HAVE_GETGROUPS = "1" HAVE_GETHOSTBYADDR = "1" HAVE_GETHOSTBYNAME = "1" HAVE_GETHOSTBYNAME_R = "1" HAVE_GETHOSTBYNAME_R_3_ARG = "0" HAVE_GETHOSTBYNAME_R_5_ARG = "0" HAVE_GETHOSTBYNAME_R_6_ARG = "1" HAVE_GETHOSTNAME = "1" HAVE_GETITIMER = "1" HAVE_GETLOADAVG = "1" HAVE_GETLOGIN = "1" HAVE_GETNAMEINFO = "1" HAVE_GETPAGESIZE = "1" HAVE_GETPEERNAME = "1" HAVE_GETPGID = "1" HAVE_GETPGRP = "1" HAVE_GETPID = "1" HAVE_GETPPID = "1" HAVE_GETPRIORITY = "1" HAVE_GETPROTOBYNAME = "1" HAVE_GETPWENT = "1" HAVE_GETPWNAM_R = "1" HAVE_GETPWUID = "1" HAVE_GETPWUID_R = "1" HAVE_GETRANDOM = "1" HAVE_GETRANDOM_SYSCALL = "1" HAVE_GETRESGID = "1" HAVE_GETRESUID = "1" HAVE_GETRUSAGE = "1" HAVE_GETSERVBYNAME = "1" HAVE_GETSERVBYPORT = "1" HAVE_GETSID = "1" HAVE_GETSOCKNAME = "1" HAVE_GETSPENT = "1" HAVE_GETSPNAM = "1" HAVE_GETUID = "1" HAVE_GETWD = "1" HAVE_GLIBC_MEMMOVE_BUG = "0" HAVE_GRP_H = "1" HAVE_HSTRERROR = "1" HAVE_HTOLE64 = "1" HAVE_IEEEFP_H = "0" HAVE_IF_NAMEINDEX = "1" HAVE_INET_ATON = "1" HAVE_INET_NTOA = "1" HAVE_INET_PTON = "1" HAVE_INITGROUPS = "1" HAVE_INTTYPES_H = "1" HAVE_IO_H = "0" HAVE_IPA_PURE_CONST_BUG = "0" HAVE_KILL = "1" HAVE_KILLPG = "1" HAVE_KQUEUE = "0" HAVE_LANGINFO_H = "1" HAVE_LARGEFILE_SUPPORT = "0" HAVE_LCHFLAGS = "0" HAVE_LCHMOD = "0" HAVE_LCHOWN = "1" HAVE_LIBB2 = "0" HAVE_LIBDB = "1" HAVE_LIBDL = "1" HAVE_LIBDLD = "0" HAVE_LIBGDBM_COMPAT = "0" HAVE_LIBIEEE = "0" HAVE_LIBINTL_H = "1" HAVE_LIBNDBM = "0" HAVE_LIBREADLINE = "1" HAVE_LIBRESOLV = "0" HAVE_LIBSENDFILE = "0" HAVE_LIBSQLITE3 = "1" HAVE_LIBUTIL_H = "0" HAVE_LINK = "1" HAVE_LINKAT = "1" HAVE_LINUX_AUXVEC_H = "1" HAVE_LINUX_CAN_BCM_H = "1" HAVE_LINUX_CAN_H = "1" HAVE_LINUX_CAN_J1939_H = "1" HAVE_LINUX_CAN_RAW_FD_FRAMES = "1" HAVE_LINUX_CAN_RAW_H = "1" HAVE_LINUX_CAN_RAW_JOIN_FILTERS = "1" HAVE_LINUX_LIMITS_H = "1" HAVE_LINUX_MEMFD_H = "1" HAVE_LINUX_NETLINK_H = "1" HAVE_LINUX_QRTR_H = "1" HAVE_LINUX_RANDOM_H = "1" HAVE_LINUX_SOUNDCARD_H = "1" HAVE_LINUX_TIPC_H = "1" HAVE_LINUX_VM_SOCKETS_H = "1" HAVE_LINUX_WAIT_H = "1" HAVE_LISTEN = "1" HAVE_LOCKF = "1" HAVE_LOG1P = "1" HAVE_LOG2 = "1" HAVE_LOGIN_TTY = "1" HAVE_LONG_DOUBLE = "1" HAVE_LSTAT = "1" HAVE_LUTIMES = "1" HAVE_LZMA_H = "0" HAVE_MADVISE = "1" HAVE_MAKEDEV = "1" HAVE_MBRTOWC = "1" HAVE_MEMFD_CREATE = "1" HAVE_MEMORY_H = "1" HAVE_MEMRCHR = "1" HAVE_MKDIRAT = "1" HAVE_MKFIFO = "1" HAVE_MKFIFOAT = "1" HAVE_MKNOD = "1" HAVE_MKNODAT = "1" HAVE_MKTIME = "1" HAVE_MMAP = "1" HAVE_MREMAP = "1" HAVE_NANOSLEEP = "1" HAVE_NCURSES_H = "1" HAVE_NDBM_H = "0" HAVE_NDIR_H = "0" HAVE_NETCAN_CAN_H = "0" HAVE_NETDB_H = "1" HAVE_NETINET_IN_H = "1" HAVE_NETPACKET_PACKET_H = "1" HAVE_NET_IF_H = "1" HAVE_NICE = "1" HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION = "0" HAVE_OPENAT = "1" HAVE_OPENDIR = "1" HAVE_OPENPTY = "1" HAVE_PATHCONF = "1" HAVE_PAUSE = "1" HAVE_PIPE = "1" HAVE_PIPE2 = "1" HAVE_PLOCK = "0" HAVE_POLL = "1" HAVE_POLL_H = "1" HAVE_POSIX_FADVISE = "1" HAVE_POSIX_FALLOCATE = "1" HAVE_POSIX_SPAWN = "1" HAVE_POSIX_SPAWNP = "1" HAVE_PREAD = "1" HAVE_PREADV = "1" HAVE_PREADV2 = "1" HAVE_PRLIMIT = "1" HAVE_PROCESS_H = "0" HAVE_PROTOTYPES = "1" HAVE_PTHREAD_CONDATTR_SETCLOCK = "1" HAVE_PTHREAD_DESTRUCTOR = "0" HAVE_PTHREAD_GETCPUCLOCKID = "1" HAVE_PTHREAD_H = "1" HAVE_PTHREAD_INIT = "0" HAVE_PTHREAD_KILL = "1" HAVE_PTHREAD_SIGMASK = "1" HAVE_PTHREAD_STUBS = "0" HAVE_PTY_H = "1" HAVE_PWRITE = "1" HAVE_PWRITEV = "1" HAVE_PWRITEV2 = "1" HAVE_READLINK = "1" HAVE_READLINKAT = "1" HAVE_READV = "1" HAVE_REALPATH = "1" HAVE_RECVFROM = "1" HAVE_RENAMEAT = "1" HAVE_RL_APPEND_HISTORY = "1" HAVE_RL_CATCH_SIGNAL = "1" HAVE_RL_COMPDISP_FUNC_T = "1" HAVE_RL_COMPLETION_APPEND_CHARACTER = "1" HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK = "1" HAVE_RL_COMPLETION_MATCHES = "1" HAVE_RL_COMPLETION_SUPPRESS_APPEND = "1" HAVE_RL_PRE_INPUT_HOOK = "1" HAVE_RL_RESIZE_TERMINAL = "1" HAVE_RPC_RPC_H = "1" HAVE_RTPSPAWN = "0" HAVE_SCHED_GET_PRIORITY_MAX = "1" HAVE_SCHED_H = "1" HAVE_SCHED_RR_GET_INTERVAL = "1" HAVE_SCHED_SETAFFINITY = "1" HAVE_SCHED_SETPARAM = "1" HAVE_SCHED_SETSCHEDULER = "1" HAVE_SEM_CLOCKWAIT = "1" HAVE_SEM_GETVALUE = "1" HAVE_SEM_OPEN = "1" HAVE_SEM_TIMEDWAIT = "1" HAVE_SEM_UNLINK = "1" HAVE_SENDFILE = "1" HAVE_SENDTO = "1" HAVE_SETEGID = "1" HAVE_SETEUID = "1" HAVE_SETGID = "1" HAVE_SETGROUPS = "1" HAVE_SETHOSTNAME = "1" HAVE_SETITIMER = "1" HAVE_SETJMP_H = "1" HAVE_SETLOCALE = "1" HAVE_SETPGID = "1" HAVE_SETPGRP = "1" HAVE_SETPRIORITY = "1" HAVE_SETREGID = "1" HAVE_SETRESGID = "1" HAVE_SETRESUID = "1" HAVE_SETREUID = "1" HAVE_SETSID = "1" HAVE_SETSOCKOPT = "1" HAVE_SETUID = "1" HAVE_SETVBUF = "1" HAVE_SHADOW_H = "1" HAVE_SHM_OPEN = "1" HAVE_SHM_UNLINK = "1" HAVE_SHUTDOWN = "1" HAVE_SIGACTION = "1" HAVE_SIGALTSTACK = "1" HAVE_SIGFILLSET = "1" HAVE_SIGINFO_T_SI_BAND = "1" HAVE_SIGINTERRUPT = "1" HAVE_SIGNAL_H = "1" HAVE_SIGPENDING = "1" HAVE_SIGRELSE = "1" HAVE_SIGTIMEDWAIT = "1" HAVE_SIGWAIT = "1" HAVE_SIGWAITINFO = "1" HAVE_SNPRINTF = "1" HAVE_SOCKADDR_ALG = "1" HAVE_SOCKADDR_SA_LEN = "0" HAVE_SOCKADDR_STORAGE = "1" HAVE_SOCKET = "1" HAVE_SOCKETPAIR = "1" HAVE_SPAWN_H = "1" HAVE_SPLICE = "1" HAVE_SSIZE_T = "1" HAVE_STATVFS = "1" HAVE_STAT_TV_NSEC = "1" HAVE_STAT_TV_NSEC2 = "0" HAVE_STDARG_PROTOTYPES = "1" HAVE_STDINT_H = "1" HAVE_STDLIB_H = "1" HAVE_STD_ATOMIC = "1" HAVE_STRFTIME = "1" HAVE_STRINGS_H = "1" HAVE_STRING_H = "1" HAVE_STRLCPY = "0" HAVE_STROPTS_H = "0" HAVE_STRSIGNAL = "1" HAVE_STRUCT_PASSWD_PW_GECOS = "1" HAVE_STRUCT_PASSWD_PW_PASSWD = "1" HAVE_STRUCT_STAT_ST_BIRTHTIME = "0" HAVE_STRUCT_STAT_ST_BLKSIZE = "1" HAVE_STRUCT_STAT_ST_BLOCKS = "1" HAVE_STRUCT_STAT_ST_FLAGS = "0" HAVE_STRUCT_STAT_ST_GEN = "0" HAVE_STRUCT_STAT_ST_RDEV = "1" HAVE_STRUCT_TM_TM_ZONE = "1" HAVE_SYMLINK = "1" HAVE_SYMLINKAT = "1" HAVE_SYNC = "1" HAVE_SYSCONF = "1" HAVE_SYSEXITS_H = "1" HAVE_SYSLOG_H = "1" HAVE_SYSTEM = "1" HAVE_SYS_AUDIOIO_H = "0" HAVE_SYS_AUXV_H = "1" HAVE_SYS_BSDTTY_H = "0" HAVE_SYS_DEVPOLL_H = "0" HAVE_SYS_DIR_H = "0" HAVE_SYS_ENDIAN_H = "0" HAVE_SYS_EPOLL_H = "1" HAVE_SYS_EVENTFD_H = "1" HAVE_SYS_EVENT_H = "0" HAVE_SYS_FILE_H = "1" HAVE_SYS_IOCTL_H = "1" HAVE_SYS_KERN_CONTROL_H = "0" HAVE_SYS_LOADAVG_H = "0" HAVE_SYS_LOCK_H = "0" HAVE_SYS_MEMFD_H = "0" HAVE_SYS_MKDEV_H = "0" HAVE_SYS_MMAN_H = "1" HAVE_SYS_MODEM_H = "0" HAVE_SYS_NDIR_H = "0" HAVE_SYS_PARAM_H = "1" HAVE_SYS_POLL_H = "1" HAVE_SYS_RANDOM_H = "1" HAVE_SYS_RESOURCE_H = "1" HAVE_SYS_SELECT_H = "1" HAVE_SYS_SENDFILE_H = "1" HAVE_SYS_SOCKET_H = "1" HAVE_SYS_SOUNDCARD_H = "1" HAVE_SYS_STATVFS_H = "1" HAVE_SYS_STAT_H = "1" HAVE_SYS_SYSCALL_H = "1" HAVE_SYS_SYSMACROS_H = "1" HAVE_SYS_SYS_DOMAIN_H = "0" HAVE_SYS_TERMIO_H = "0" HAVE_SYS_TIMES_H = "1" HAVE_SYS_TIME_H = "1" HAVE_SYS_TYPES_H = "1" HAVE_SYS_UIO_H = "1" HAVE_SYS_UN_H = "1" HAVE_SYS_UTSNAME_H = "1" HAVE_SYS_WAIT_H = "1" HAVE_SYS_XATTR_H = "1" HAVE_TCGETPGRP = "1" HAVE_TCSETPGRP = "1" HAVE_TEMPNAM = "1" HAVE_TERMIOS_H = "1" HAVE_TERM_H = "1" HAVE_TIMEGM = "1" HAVE_TIMES = "1" HAVE_TMPFILE = "1" HAVE_TMPNAM = "1" HAVE_TMPNAM_R = "1" HAVE_TM_ZONE = "1" HAVE_TRUNCATE = "1" HAVE_TTYNAME = "1" HAVE_TZNAME = "0" HAVE_UMASK = "1" HAVE_UNAME = "1" HAVE_UNISTD_H = "1" HAVE_UNLINKAT = "1" HAVE_USABLE_WCHAR_T = "0" HAVE_UTIL_H = "0" HAVE_UTIMENSAT = "1" HAVE_UTIMES = "1" HAVE_UTIME_H = "1" HAVE_UTMP_H = "1" HAVE_UUID_CREATE = "0" HAVE_UUID_ENC_BE = "0" HAVE_UUID_GENERATE_TIME_SAFE = "1" HAVE_UUID_H = "1" HAVE_UUID_UUID_H = "0" HAVE_VFORK = "1" HAVE_WAIT = "1" HAVE_WAIT3 = "1" HAVE_WAIT4 = "1" HAVE_WAITID = "1" HAVE_WAITPID = "1" HAVE_WCHAR_H = "1" HAVE_WCSCOLL = "1" HAVE_WCSFTIME = "1" HAVE_WCSXFRM = "1" HAVE_WMEMCMP = "1" HAVE_WORKING_TZSET = "1" HAVE_WRITEV = "1" HAVE_ZLIB_COPY = "1" HAVE_ZLIB_H = "0" HAVE__GETPTY = "0" HOSTRUNNER = "" HOST_GNU_TYPE = "x86_64-pc-linux-gnu" INCLDIRSTOMAKE = "/usr/local/include /usr/local/include /usr/local/include/python3.11 /usr/local/include/python3.11" INCLUDEDIR = "/usr/local/include" INCLUDEPY = "/usr/local/include/python3.11" INSTALL = "/usr/bin/install -c" INSTALL_DATA = "/usr/bin/install -c -m 644" INSTALL_PROGRAM = "/usr/bin/install -c" INSTALL_SCRIPT = "/usr/bin/install -c" INSTALL_SHARED = "/usr/bin/install -c -m 755" INSTSONAME = "libpython3.11.so.1.0" IO_H = "Modules/_io/_iomodule.h" IO_OBJS = "\" LDCXXSHARED = "g++ -shared" LDFLAGS = "" LDLIBRARY = "libpython3.11.so" LDLIBRARYDIR = "" LDSHARED = "gcc -shared" LDVERSION = "3.11" LIBC = "" LIBDEST = "/usr/local/lib/python3.11" LIBDIR = "/usr/local/lib" LIBEXPAT_A = "Modules/expat/libexpat.a" LIBEXPAT_CFLAGS = "-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal -I. -I./Include -fPIC -fPIC" LIBEXPAT_HEADERS = "\" LIBEXPAT_OBJS = "\" LIBFFI_INCLUDEDIR = "" LIBM = "-lm" LIBMPDEC_A = "Modules/_decimal/libmpdec/libmpdec.a" LIBMPDEC_CFLAGS = "-I./Modules/_decimal/libmpdec -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1 -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal -I. -I./Include -fPIC -fPIC" LIBMPDEC_HEADERS = "\" LIBMPDEC_OBJS = "\" LIBOBJDIR = "Python/" LIBOBJS = "" LIBPC = "/usr/local/lib/pkgconfig" LIBPL = "/usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu" LIBPYTHON = "" LIBRARY = "libpython3.11.a" LIBRARY_DEPS = "libpython3.11.a libpython3.11.so libpython3.so" LIBRARY_OBJS = "\" LIBRARY_OBJS_OMIT_FROZEN = "\" LIBS = "-ldl" LIBSUBDIRS = "asyncio \" LINKCC = "gcc" LINKFORSHARED = "-Xlinker -export-dynamic" LINK_PYTHON_DEPS = "libpython3.11.a libpython3.11.so libpython3.so" LINK_PYTHON_OBJS = "-L. -lpython3.11" LIPO_32BIT_FLAGS = "" LIPO_INTEL64_FLAGS = "" LLVM_PROF_ERR = "no" LLVM_PROF_FILE = "" LLVM_PROF_MERGER = "true" LN = "ln" LOCALMODLIBS = "" MACHDEP = "linux" MACHDEP_OBJS = "" MACHDESTLIB = "/usr/local/lib/python3.11" MACOSX_DEPLOYMENT_TARGET = "" MAINCC = "gcc" MAJOR_IN_MKDEV = "0" MAJOR_IN_SYSMACROS = "1" MAKESETUP = "./Modules/makesetup" MANDIR = "/usr/local/share/man" MKDIR_P = "/usr/bin/mkdir -p" MODBUILT_NAMES = "atexit faulthandler posix _signal _tracemalloc _codecs _collections errno _io itertools _sre _thread time _weakref _abc _functools _locale _operator _stat _symtable pwd xxsubtype" MODDISABLED_NAMES = "" MODLIBS = "" MODOBJS = "Modules/atexitmodule.o Modules/faulthandler.o Modules/posixmodule.o Modules/signalmodule.o Modules/_tracemalloc.o Modules/_codecsmodule.o Modules/_collectionsmodule.o Modules/errnomodule.o Modules/_io/_iomodule.o Modules/_io/iobase.o Modules/_io/fileio.o Modules/_io/bytesio.o Modules/_io/bufferedio.o Modules/_io/textio.o Modules/_io/stringio.o Modules/itertoolsmodule.o Modules/_sre/sre.o Modules/_threadmodule.o Modules/timemodule.o Modules/_weakref.o Modules/_abc.o Modules/_functoolsmodule.o Modules/_localemodule.o Modules/_operator.o Modules/_stat.o Modules/symtablemodule.o Modules/pwdmodule.o Modules/xxsubtype.o" MODSHARED_NAMES = "" MODULE_ARRAY_STATE = "yes" MODULE_ATEXIT_LDFLAGS = "" MODULE_AUDIOOP_LDFLAGS = "-lm" MODULE_AUDIOOP_STATE = "yes" MODULE_BINASCII_CFLAGS = "-DUSE_ZLIB_CRC32" MODULE_BINASCII_LDFLAGS = "-lz" MODULE_BINASCII_STATE = "yes" MODULE_CMATH_DEPS = "./Modules/_math.h" MODULE_CMATH_LDFLAGS = "-lm" MODULE_CMATH_STATE = "yes" MODULE_ERRNO_LDFLAGS = "" MODULE_FAULTHANDLER_LDFLAGS = "" MODULE_FCNTL_LDFLAGS = "" MODULE_FCNTL_STATE = "yes" MODULE_GRP_STATE = "yes" MODULE_ITERTOOLS_LDFLAGS = "" MODULE_MATH_DEPS = "./Modules/_math.h" MODULE_MATH_LDFLAGS = "-lm" MODULE_MATH_STATE = "yes" MODULE_MMAP_STATE = "yes" MODULE_NIS_CFLAGS = "-I/usr/include/tirpc" MODULE_NIS_LDFLAGS = "-lnsl -ltirpc" MODULE_NIS_STATE = "yes" MODULE_OBJS = "\" MODULE_OSSAUDIODEV_LDFLAGS = "" MODULE_OSSAUDIODEV_STATE = "yes" MODULE_POSIX_LDFLAGS = "" MODULE_PWD_LDFLAGS = "" MODULE_PWD_STATE = "yes" MODULE_PYEXPAT_CFLAGS = "" MODULE_PYEXPAT_DEPS = "" MODULE_PYEXPAT_LDFLAGS = "-lexpat" MODULE_PYEXPAT_STATE = "yes" MODULE_RESOURCE_STATE = "yes" MODULE_SELECT_STATE = "yes" MODULE_SPWD_STATE = "yes" MODULE_SYSLOG_STATE = "yes" MODULE_TERMIOS_STATE = "yes" MODULE_TIME_LDFLAGS = "" MODULE_TIME_STATE = "yes" MODULE_UNICODEDATA_DEPS = "./Modules/unicodedata_db.h ./Modules/unicodename_db.h" MODULE_UNICODEDATA_STATE = "yes" MODULE_XXLIMITED_35_STATE = "yes" MODULE_XXLIMITED_STATE = "yes" MODULE_XXSUBTYPE_LDFLAGS = "" MODULE_ZLIB_CFLAGS = "" MODULE_ZLIB_LDFLAGS = "-lz" MODULE_ZLIB_STATE = "yes" MODULE__ABC_LDFLAGS = "" MODULE__ASYNCIO_STATE = "yes" MODULE__BISECT_STATE = "yes" MODULE__BLAKE2_CFLAGS = "" MODULE__BLAKE2_DEPS = "./Modules/_blake2/impl/blake2-config.h ./Modules/_blake2/impl/blake2-impl.h ./Modules/_blake2/impl/blake2.h ./Modules/_blake2/impl/blake2b-load-sse2.h ./Modules/_blake2/impl/blake2b-load-sse41.h ./Modules/_blake2/impl/blake2b-ref.c ./Modules/_blake2/impl/blake2b-round.h ./Modules/_blake2/impl/blake2b.c ./Modules/_blake2/impl/blake2s-load-sse2.h ./Modules/_blake2/impl/blake2s-load-sse41.h ./Modules/_blake2/impl/blake2s-load-xop.h ./Modules/_blake2/impl/blake2s-ref.c ./Modules/_blake2/impl/blake2s-round.h ./Modules/_blake2/impl/blake2s.c ./Modules/_blake2/blake2module.h ./Modules/hashlib.h" MODULE__BLAKE2_LDFLAGS = "" MODULE__BLAKE2_STATE = "yes" MODULE__BZ2_CFLAGS = "" MODULE__BZ2_LDFLAGS = "-lbz2" MODULE__BZ2_STATE = "yes" MODULE__CODECS_CN_STATE = "yes" MODULE__CODECS_HK_STATE = "yes" MODULE__CODECS_ISO2022_STATE = "yes" MODULE__CODECS_JP_STATE = "yes" MODULE__CODECS_KR_STATE = "yes" MODULE__CODECS_LDFLAGS = "" MODULE__CODECS_TW_STATE = "yes" MODULE__COLLECTIONS_LDFLAGS = "" MODULE__CONTEXTVARS_STATE = "yes" MODULE__CRYPT_CFLAGS = "" MODULE__CRYPT_LDFLAGS = "-lcrypt" MODULE__CRYPT_STATE = "yes" MODULE__CSV_STATE = "yes" MODULE__CTYPES_DEPS = "./Modules/_ctypes/ctypes.h" MODULE__CTYPES_TEST_LDFLAGS = "-lm" MODULE__CTYPES_TEST_STATE = "yes" MODULE__DATETIME_LDFLAGS = "-lm" MODULE__DATETIME_STATE = "yes" MODULE__DECIMAL_CFLAGS = "-I./Modules/_decimal/libmpdec -DCONFIG_64=1 -DANSI=1 -DHAVE_UINT128_T=1" MODULE__DECIMAL_DEPS = "./Modules/_decimal/docstrings.h \ Modules/_decimal/libmpdec/libmpdec.a" MODULE__DECIMAL_LDFLAGS = "-lm Modules/_decimal/libmpdec/libmpdec.a" MODULE__DECIMAL_STATE = "yes" MODULE__ELEMENTTREE_CFLAGS = "" MODULE__ELEMENTTREE_DEPS = "./Modules/pyexpat.c" MODULE__ELEMENTTREE_STATE = "yes" MODULE__FUNCTOOLS_LDFLAGS = "" MODULE__GDBM_CFLAGS = "" MODULE__GDBM_LDFLAGS = "-lgdbm" MODULE__GDBM_STATE = "yes" MODULE__HASHLIB_CFLAGS = "" MODULE__HASHLIB_DEPS = "./Modules/hashlib.h" MODULE__HASHLIB_LDFLAGS = "-lcrypto" MODULE__HASHLIB_STATE = "yes" MODULE__HEAPQ_STATE = "yes" MODULE__IO_CFLAGS = "-I./Modules/_io" MODULE__IO_DEPS = "./Modules/_io/_iomodule.h" MODULE__IO_LDFLAGS = "" MODULE__IO_STATE = "yes" MODULE__JSON_STATE = "yes" MODULE__LOCALE_LDFLAGS = "" MODULE__LSPROF_STATE = "yes" MODULE__LZMA_CFLAGS = "" MODULE__LZMA_LDFLAGS = "-llzma" MODULE__LZMA_STATE = "yes" MODULE__MD5_DEPS = "./Modules/hashlib.h" MODULE__MD5_STATE = "yes" MODULE__MULTIBYTECODEC_STATE = "yes" MODULE__MULTIPROCESSING_CFLAGS = "-I./Modules/_multiprocessing" MODULE__MULTIPROCESSING_STATE = "yes" MODULE__OPCODE_STATE = "yes" MODULE__OPERATOR_LDFLAGS = "" MODULE__PICKLE_STATE = "yes" MODULE__POSIXSHMEM_CFLAGS = "-I./Modules/_multiprocessing" MODULE__POSIXSHMEM_LDFLAGS = "" MODULE__POSIXSHMEM_STATE = "yes" MODULE__POSIXSUBPROCESS_STATE = "yes" MODULE__QUEUE_STATE = "yes" MODULE__RANDOM_STATE = "yes" MODULE__SCPROXY_STATE = "n/a" MODULE__SHA1_DEPS = "./Modules/hashlib.h" MODULE__SHA1_STATE = "yes" MODULE__SHA256_DEPS = "./Modules/hashlib.h" MODULE__SHA256_STATE = "yes" MODULE__SHA3_DEPS = "./Modules/_sha3/sha3.c ./Modules/_sha3/sha3.h ./Modules/hashlib.h" MODULE__SHA3_STATE = "yes" MODULE__SHA512_DEPS = "./Modules/hashlib.h" MODULE__SHA512_STATE = "yes" MODULE__SIGNAL_LDFLAGS = "" MODULE__SOCKET_DEPS = "./Modules/socketmodule.h ./Modules/addrinfo.h ./Modules/getaddrinfo.c ./Modules/getnameinfo.c" MODULE__SOCKET_STATE = "yes" MODULE__SQLITE3_CFLAGS = "-I./Modules/_sqlite" MODULE__SQLITE3_DEPS = "./Modules/_sqlite/connection.h ./Modules/_sqlite/cursor.h ./Modules/_sqlite/microprotocols.h ./Modules/_sqlite/module.h ./Modules/_sqlite/prepare_protocol.h ./Modules/_sqlite/row.h ./Modules/_sqlite/util.h" MODULE__SQLITE3_LDFLAGS = "-lsqlite3" MODULE__SQLITE3_STATE = "yes" MODULE__SRE_LDFLAGS = "" MODULE__SSL_CFLAGS = "" MODULE__SSL_DEPS = "./Modules/_ssl.h ./Modules/_ssl/cert.c ./Modules/_ssl/debughelpers.c ./Modules/_ssl/misc.c ./Modules/_ssl_data.h ./Modules/_ssl_data_111.h ./Modules/_ssl_data_300.h ./Modules/socketmodule.h" MODULE__SSL_LDFLAGS = "-lssl -lcrypto" MODULE__SSL_STATE = "yes" MODULE__STATISTICS_LDFLAGS = "-lm" MODULE__STATISTICS_STATE = "yes" MODULE__STAT_LDFLAGS = "" MODULE__STRUCT_STATE = "yes" MODULE__SYMTABLE_LDFLAGS = "" MODULE__TESTBUFFER_STATE = "yes" MODULE__TESTCAPI_DEPS = "./Modules/testcapi_long.h" MODULE__TESTCAPI_STATE = "yes" MODULE__TESTCLINIC_STATE = "yes" MODULE__TESTIMPORTMULTIPLE_STATE = "yes" MODULE__TESTINTERNALCAPI_STATE = "yes" MODULE__TESTMULTIPHASE_STATE = "yes" MODULE__THREAD_LDFLAGS = "" MODULE__TKINTER_CFLAGS = "-I/usr/include/tcl8.6 -Wno-strict-prototypes -DWITH_APPINIT=1" MODULE__TKINTER_LDFLAGS = "-ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6" MODULE__TKINTER_STATE = "yes" MODULE__TRACEMALLOC_LDFLAGS = "" MODULE__TYPING_STATE = "yes" MODULE__UUID_CFLAGS = "-I/usr/include/uuid" MODULE__UUID_LDFLAGS = "-luuid" MODULE__UUID_STATE = "yes" MODULE__WEAKREF_LDFLAGS = "" MODULE__XXSUBINTERPRETERS_STATE = "yes" MODULE__XXTESTFUZZ_STATE = "yes" MODULE__ZONEINFO_STATE = "yes" MULTIARCH = "x86_64-linux-gnu" MULTIARCH_CPPFLAGS = "-DMULTIARCH=\"x86_64-linux-gnu\"" MVWDELCH_IS_EXPRESSION = "1" NO_AS_NEEDED = "-Wl,--no-as-needed" OBJECT_OBJS = "\" OPENSSL_INCLUDES = "" OPENSSL_LDFLAGS = "" OPENSSL_LIBS = "-lssl -lcrypto" OPENSSL_RPATH = "" OPT = "-DNDEBUG -g -fwrapv -O3 -Wall" OTHER_LIBTOOL_OPT = "" PACKAGE_BUGREPORT = "0" PACKAGE_NAME = "0" PACKAGE_STRING = "0" PACKAGE_TARNAME = "0" PACKAGE_URL = "0" PACKAGE_VERSION = "0" PARSER_HEADERS = "\" PARSER_OBJS = "\ \ Parser/myreadline.o Parser/tokenizer.o" PEGEN_HEADERS = "\" PEGEN_OBJS = "\" PGO_PROF_GEN_FLAG = "-fprofile-generate" PGO_PROF_USE_FLAG = "-fprofile-use -fprofile-correction" PLATLIBDIR = "lib" POBJS = "\" POSIX_SEMAPHORES_NOT_ENABLED = "0" PROFILE_TASK = "-m test --pgo --timeout=1200" PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT = "1" PTHREAD_SYSTEM_SCHED_SUPPORTED = "1" PURIFY = "" PY3LIBRARY = "libpython3.so" PYLONG_BITS_IN_DIGIT = "0" PYTHON = "python" PYTHONFRAMEWORK = "" PYTHONFRAMEWORKDIR = "no-framework" PYTHONFRAMEWORKINSTALLDIR = "" PYTHONFRAMEWORKPREFIX = "" PYTHONPATH = "" PYTHON_FOR_BUILD = "./python -E" PYTHON_FOR_BUILD_DEPS = "python" PYTHON_FOR_FREEZE = "./_bootstrap_python" PYTHON_FOR_REGEN = "" PYTHON_HEADERS = "\" PYTHON_OBJS = "\" PY_BUILTIN_HASHLIB_HASHES = ""md5,sha1,sha256,sha512,sha3,blake2"" PY_BUILTIN_MODULE_CFLAGS = "-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal -I. -I./Include -fPIC -DPy_BUILD_CORE_BUILTIN" PY_CFLAGS = "-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall" PY_CFLAGS_NODIST = "-fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal" PY_COERCE_C_LOCALE = "1" PY_CORE_CFLAGS = "-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal -I. -I./Include -fPIC -DPy_BUILD_CORE" PY_CORE_LDFLAGS = "-fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g" PY_CPPFLAGS = "-I. -I./Include" PY_ENABLE_SHARED = "1" PY_FORMAT_SIZE_T = ""z"" PY_LDFLAGS = "" PY_LDFLAGS_NODIST = "-fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g" PY_LDFLAGS_NOLTO = "-fno-lto" PY_SQLITE_ENABLE_LOAD_EXTENSION = "1" PY_SQLITE_HAVE_SERIALIZE = "1" PY_SSL_DEFAULT_CIPHERS = "1" PY_SSL_DEFAULT_CIPHER_STRING = "0" PY_STDMODULE_CFLAGS = "-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-use -fprofile-correction -I./Include/internal -I. -I./Include -fPIC" PY_SUPPORT_TIER = "1" Py_DEBUG = "0" Py_ENABLE_SHARED = "1" Py_HASH_ALGORITHM = "0" Py_STATS = "0" Py_SUNOS_VERSION = "0" Py_TRACE_REFS = "0" QUICKTESTOPTS = "-x test_subprocess test_io test_lib2to3 \" READELF = "readelf" RESSRCDIR = "Mac/Resources/framework" RETSIGTYPE = "void" RUNSHARED = "LD_LIBRARY_PATH=/usr/src/python" SCRIPTDIR = "/usr/local/lib" SETPGRP_HAVE_ARG = "0" SHELL = "/bin/sh" SHLIBS = "-ldl" SHLIB_SUFFIX = ".so" SIGNED_RIGHT_SHIFT_ZERO_FILLS = "0" SITEPATH = "" SIZEOF_DOUBLE = "8" SIZEOF_FLOAT = "4" SIZEOF_FPOS_T = "16" SIZEOF_INT = "4" SIZEOF_LONG = "8" SIZEOF_LONG_DOUBLE = "16" SIZEOF_LONG_LONG = "8" SIZEOF_OFF_T = "8" SIZEOF_PID_T = "4" SIZEOF_PTHREAD_KEY_T = "4" SIZEOF_PTHREAD_T = "8" SIZEOF_SHORT = "2" SIZEOF_SIZE_T = "8" SIZEOF_TIME_T = "8" SIZEOF_UINTPTR_T = "8" SIZEOF_VOID_P = "8" SIZEOF_WCHAR_T = "4" SIZEOF__BOOL = "1" SOABI = "cpython-311-x86_64-linux-gnu" SRCDIRS = "Modules Modules/_blake2 Modules/_ctypes Modules/_decimal Modules/_decimal/libmpdec Modules/_io Modules/_multiprocessing Modules/_sha3 Modules/_sqlite Modules/_sre Modules/_xxtestfuzz Modules/cjkcodecs Modules/expat Objects Parser Programs Python Python/frozen_modules Python/deepfreeze" SRC_GDB_HOOKS = "./Tools/gdb/libpython.py" STATIC_LIBPYTHON = "1" STDC_HEADERS = "1" STRICT_SYSV_CURSES = "/* Don't use ncurses extensions */" STRIPFLAG = "-s" SUBDIRS = "" SUBDIRSTOO = "Include Lib Misc" SYSLIBS = "-lm" SYS_SELECT_WITH_SYS_TIME = "1" TESTOPTS = "" TESTPATH = "" TESTPYTHON = "LD_LIBRARY_PATH=/usr/src/python ./python -E" TESTPYTHONOPTS = "" TESTRUNNER = "LD_LIBRARY_PATH=/usr/src/python ./python -E ./Tools/scripts/run_tests.py" TESTSUBDIRS = "ctypes/test \" TESTTIMEOUT = "1200" TEST_MODULES = "yes" THREAD_STACK_SIZE = "0" TIMEMODULE_LIB = "0" TIME_WITH_SYS_TIME = "1" TM_IN_SYS_TIME = "0" TZPATH = "/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo" UNICODE_DEPS = "\" UNIVERSALSDK = "" UPDATE_FILE = "./Tools/scripts/update_file.py" USE_COMPUTED_GOTOS = "0" VERSION = "3.11" WASM_ASSETS_DIR = "./usr/local" WASM_STDLIB = "./usr/local/lib/python3.11/os.py" WHEEL_PKG_DIR = "" WINDOW_HAS_FLAGS = "1" WITH_DECIMAL_CONTEXTVAR = "1" WITH_DOC_STRINGS = "1" WITH_DTRACE = "0" WITH_DYLD = "0" WITH_EDITLINE = "0" WITH_FREELISTS = "1" WITH_LIBINTL = "0" WITH_NEXT_FRAMEWORK = "0" WITH_PYMALLOC = "1" WITH_VALGRIND = "0" X87_DOUBLE_ROUNDING = "0" XMLLIBSUBDIRS = "xml xml/dom xml/etree xml/parsers xml/sax" abiflags = "" abs_builddir = "/usr/src/python" abs_srcdir = "/usr/src/python" base = "/usr/local" datarootdir = "/usr/local/share" exec_prefix = "/usr/local" installed_base = "/usr/local" installed_platbase = "/usr/local" platbase = "/usr/local" platlibdir = "lib" prefix = "/usr/local" projectbase = "/usr/local/bin" py_version = "3.11.8" py_version_nodot = "311" py_version_nodot_plat = "" py_version_short = "3.11" srcdir = "/usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu" userbase = "/root/.local" ```

Example pyproject.toml

No response

Poetry Runtime Logs

```bash session > [13/14] RUN poetry install --only main --compile: 0.600 Skipping virtualenv creation, as specified in config file. 0.768 Installing dependencies from lock file 1.976 1.976 Package operations: 291 installs, 3 updates, 0 removals 1.976 1.977 - Installing six (1.16.0) 2.310 - Installing jmespath (1.0.1) 2.310 - Installing pyasn1 (0.5.1) 2.312 - Installing python-dateutil (2.9.0.post0) 2.589 - Installing botocore (1.34.67) 2.589 - Installing cachetools (5.3.3) 2.590 - Installing cmake (3.28.3) 2.590 - Installing frozenlist (1.4.1) 2.592 - Installing lit (18.1.1) 2.593 - Installing markupsafe (2.1.5) 2.594 - Installing mdurl (0.1.2) 2.596 - Installing mpmath (1.3.0) 2.597 - Installing multidict (6.0.5) 2.598 - Installing protobuf (4.25.3) 2.599 - Installing pyasn1-modules (0.3.0) 2.600 - Installing rsa (4.9) 2.664 - Updating setuptools (65.5.1 -> 69.2.0) 2.937 - Installing sniffio (1.3.1) 8.107 - Installing aiosignal (1.3.1) 8.108 - Installing anyio (3.7.1) 8.108 - Installing attrs (23.2.0) 8.109 - Installing cymem (2.0.8) 8.109 - Installing google-auth (2.29.0) 8.111 - Installing googleapis-common-protos (1.63.0) 8.112 - Installing h11 (0.14.0) 8.112 - Installing jinja2 (3.1.3) 8.113 - Installing markdown-it-py (3.0.0) 8.114 - Installing murmurhash (1.0.10) 8.115 - Installing networkx (3.2.1) 8.115 - Installing numpy (1.26.4) 8.200 - Installing nvidia-cublas-cu11 (11.10.3.66) 8.247 - Installing nvidia-cuda-cupti-cu11 (11.7.101) 8.288 - Installing nvidia-cuda-nvrtc-cu11 (11.7.99) 8.453 - Installing nvidia-cuda-runtime-cu11 (11.7.99) 8.534 - Installing nvidia-cudnn-cu11 (8.5.0.96) 8.742 - Installing nvidia-cufft-cu11 (10.9.0.58) 8.761 - Installing nvidia-curand-cu11 (10.2.10.91) 8.887 - Installing nvidia-cusolver-cu11 (11.4.0.1) 8.984 - Installing nvidia-cusparse-cu11 (11.7.4.91) 9.025 - Installing nvidia-nccl-cu11 (2.14.3) 9.064 - Installing nvidia-nvtx-cu11 (11.7.91) 9.262 - Downgrading packaging (24.0 -> 23.2) 9.986 - Installing pygments (2.17.2) 10.51 - Installing pytz (2023.4) 11.57 - Installing s3transfer (0.10.1) 11.64 - Installing sympy (1.12) 11.81 - Installing triton (2.0.0) 24.06 - Installing typing-extensions (4.10.0) 24.18 - Installing tzdata (2024.1) 24.30 - Installing wcwidth (0.2.13) 24.54 - Installing xmod (1.8.1) 24.61 - Installing yarl (1.9.4) 72.16 Installing /usr/local/lib/python3.11/site-packages/nvidia/__init__.py over existing file 110.7 Installing /usr/local/lib/python3.11/site-packages/nvidia/__init__.py over existing file 166.9 Installing /usr/local/lib/python3.11/site-packages/nvidia/__init__.py over existing file 174.3 - Installing aiohttp (3.9.3) 174.3 - Installing appdirs (1.4.4) 174.3 - Installing asttokens (2.4.1) 174.3 - Installing blessed (1.20.0) 174.3 - Installing blinker (1.7.0) 174.3 - Installing boto3 (1.34.67) 174.3 - Installing catalogue (1.0.2) 174.3 - Installing blis (0.7.11) 174.3 - Installing cycler (0.12.1) 174.3 - Installing dill (0.3.7) 174.3 - Installing click (8.1.7) 174.3 - Installing contourpy (1.2.0) 174.5 - Installing executing (2.0.1) 174.5 - Installing faker (24.3.0) 174.5 - Installing fonttools (4.50.0) 174.6 - Installing fsspec (2024.3.1) 174.6 - Installing google-api-core (2.17.1) 174.7 - Installing greenlet (3.0.3) 174.8 - Installing httpcore (1.0.4) 174.8 - Installing itsdangerous (2.1.2) 175.0 - Installing joblib (1.3.2) 175.0 - Installing kiwisolver (1.4.5) 175.1 - Installing lightning-utilities (0.11.0) 175.3 - Installing llvmlite (0.42.0) 175.3 - Installing nvidia-ml-py (12.535.133) 175.5 - Installing opencensus-context (0.1.3) 175.5 - Installing pandas (2.1.4) 175.5 - Installing parso (0.8.3) 175.6 - Installing patsy (0.5.6) 175.6 - Installing pillow (10.2.0) 175.8 - Installing plac (1.1.3) 176.0 - Installing preshed (3.0.9) 176.1 - Installing psutil (5.9.8) 176.4 - Installing pure-eval (0.2.2) 176.4 - Installing pydantic (1.10.14) 176.4 - Installing pyparsing (3.1.2) 176.4 - Installing pyrsistent (0.20.0) 176.6 - Installing pysocks (1.7.1) 176.6 - Installing pyyaml (6.0.1) 176.8 - Installing rich (13.7.1) 176.8 - Installing runs (1.2.2) 176.9 - Installing scipy (1.11.4) 176.9 - Installing smmap (5.0.1) 177.0 - Installing soupsieve (2.5) 177.1 - Installing srsly (1.0.7) 177.2 - Installing starlette (0.27.0) 177.9 - Installing tbb (2021.11.0) 178.1 - Installing tenacity (8.2.3) 178.1 - Installing threadpoolctl (3.4.0) 178.3 - Installing torch (2.0.0) 178.3 - Installing tqdm (4.66.2) 178.5 - Installing traitlets (5.14.2) 179.1 - Installing wasabi (0.10.1) 179.1 - Installing werkzeug (3.0.1) 179.2 - Installing wrapt (1.16.0) 258.2 - Installing aiohttp-cors (0.7.0) 258.2 - Installing autogluon-common (1.0.0) 258.2 - Installing beautifulsoup4 (4.12.3) 258.2 - Installing cloudpickle (3.0.0) 258.2 - Installing colorama (0.4.6) 258.2 - Installing colorful (0.5.6) 258.2 - Installing cython (3.0.9) 258.2 - Installing daal (2024.1.0) 258.2 - Installing dash-core-components (2.0.0) 258.2 - Installing dash-html-components (2.0.0) 258.2 - Installing dash-table (5.0.0) 258.2 - Installing decorator (5.1.1) 258.3 - Installing distro (1.9.0) 258.3 - Installing editor (1.6.6) 258.4 - Installing fastapi (0.104.1) 258.4 - Installing fastcore (1.5.29) 258.4 - Installing fastprogress (1.0.3) 258.5 - Installing flask (3.0.2) 258.5 - Installing future (1.0.0) 258.5 - Installing gitdb (4.0.11) 258.5 - Installing gpustat (1.1.1) 258.5 - Installing graphviz (0.20.2) 258.6 - Installing grpcio (1.62.1) 258.9 - Installing httpx (0.27.0) 258.9 - Installing huggingface-hub (0.21.4) 259.1 - Installing jedi (0.19.1) 259.1 - Installing jsonschema (4.17.3) 259.1 - Installing mako (1.3.2) 259.1 - Installing markdown (3.6) 259.2 - Installing matplotlib (3.7.5) 259.4 - Installing matplotlib-inline (0.1.6) 259.6 - Installing msgspec (0.18.6) 259.8 - Installing multiprocess (0.70.15) 259.8 - Installing mypy-extensions (1.0.0) 259.9 - Installing nest-asyncio (1.6.0) 260.0 - Installing numba (0.59.1) 260.1 - Installing opencensus (0.11.4) 260.2 - Installing openxlab (0.0.11) 260.3 Installing /usr/local/lib/python3.11/site-packages/opencensus/__init__.py over existing file 260.3 Installing /usr/local/lib/python3.11/site-packages/opencensus/common/__init__.py over existing file 261.1 - Installing ordered-set (4.1.0) 261.1 - Installing plotly (5.20.0) 261.2 - Installing polyfactory (2.15.0) 261.7 - Installing prometheus-client (0.20.0) 261.7 - Installing prompt-toolkit (3.0.43) 261.8 - Installing py-spy (0.3.14) 262.0 - Installing py4j (0.10.9.7) 262.1 - Installing pyarrow (14.0.2) 262.1 - Installing pycryptodome (3.20.0) 262.5 - Installing pyjwt (2.8.0) 262.8 - Installing python-multipart (0.0.9) 263.0 - Installing readchar (4.0.6) 263.5 - Installing regex (2023.12.25) 263.5 - Installing retrying (1.3.4) 263.8 - Installing rich-click (1.7.4) 263.9 - Installing scikit-learn (1.4.1.post1) 264.0 - Installing smart-open (7.0.1) 264.0 - Installing sqlalchemy (2.0.28) 264.0 - Installing stack-data (0.6.3) 264.2 - Installing statsmodels (0.14.1) 264.3 - Installing tensorboardx (2.6.2.2) 264.3 - Installing thinc (7.4.6) 265.4 - Installing toolz (0.12.1) 266.1 - Installing torchmetrics (1.1.2) 266.5 - Installing types-python-dateutil (2.9.0.20240316) 266.7 - Installing uvicorn (0.29.0) 266.8 - Downgrading virtualenv (20.25.1 -> 20.4.7) 267.3 - Installing websocket-client (1.7.0) 267.5 - Installing websockets (11.0.3) 267.8 - Installing xxhash (3.4.1) 300.1 - Installing absl-py (2.1.0) 300.1 - Installing aiofiles (23.2.1) 300.1 - Installing alembic (1.13.1) 300.1 - Installing altair (5.2.0) 300.1 - Installing antlr4-python3-runtime (4.9.3) 300.1 - Installing arrow (1.3.0) 300.1 - Installing async-timeout (4.0.3) 300.1 - Installing autogluon-core (1.0.0) 300.1 - Installing autogluon-features (1.0.0) 300.1 - Installing backoff (2.2.1) 300.1 - Installing catboost (1.2.3) 300.1 - Installing comm (0.2.2) 300.2 - Installing croniter (1.4.1) 300.4 - Installing daal4py (2024.1.0) 300.4 - Installing dash (2.16.1) 300.4 - Installing datasets (2.14.4) 300.5 - Installing dateutils (0.6.12) 300.6 - Installing deepdiff (6.7.1) 300.7 - Installing docker (7.0.0) 300.7 - Installing dynaconf (3.2.5) 300.7 - Installing entrypoints (0.4) 300.9 - Installing fastdownload (0.0.7) 301.1 - Installing ffmpy (0.3.2) 301.2 - Installing gdown (5.1.0) 301.2 - Installing gitpython (3.1.42) 303.1 303.1 FileNotFoundError 303.1 303.1 [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/virtualenv/activation/nushell/activate.nu' 303.1 303.1 at /usr/local/lib/python3.11/pathlib.py:1044 in open 303.2 1040│ the built-in open() function does. 303.2 1041│ """ 303.2 1042│ if "b" not in mode: 303.2 1043│ encoding = io.text_encoding(encoding) 303.2 → 1044│ return io.open(self, mode, buffering, encoding, errors, newline) 303.2 1045│ 303.2 1046│ def read_bytes(self): 303.2 1047│ """ 303.2 1048│ Open the file in bytes mode, read it, and close the file. 303.2 303.2 Cannot install antlr4-python3-runtime. 303.2 303.2 - Installing gradio-client (0.6.1) 303.2 303.2 FileNotFoundError 303.2 303.2 [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/virtualenv/activation/nushell/activate.nu' 303.2 303.2 at /usr/local/lib/python3.11/pathlib.py:1044 in open 303.2 1040│ the built-in open() function does. 303.2 1041│ """ 303.2 1042│ if "b" not in mode: 303.2 1043│ encoding = io.text_encoding(encoding) 303.2 → 1044│ return io.open(self, mode, buffering, encoding, errors, newline) 303.2 1045│ 303.2 1046│ def read_bytes(self): 303.2 1047│ """ 303.2 1048│ Open the file in bytes mode, read it, and close the file. 303.2 303.2 Cannot install ffmpy. 303.2 303.2 - Installing gunicorn (21.2.0) 303.2 - Installing hyperopt (0.2.7) 303.2 - Installing imageio (2.34.0) 303.2 - Installing importlib-resources (6.3.2) 303.2 - Installing inquirer (3.2.4) 303.2 - Installing ipython (8.22.2) 303.2 - Installing iterative-telemetry (0.0.8) 303.2 - Installing jupyter-core (5.7.2) 303.4 - Installing jupyterlab-widgets (3.0.10) 303.5 - Installing lazy-loader (0.3) 303.7 - Installing lightgbm (4.1.0) 303.7 - Installing lightning-cloud (0.5.65) 303.8 - Installing litestar (2.7.0) 303.8 - Installing model-index (0.1.11) 303.9 - Installing nltk (3.8.1) 304.0 - Installing opendatalab (0.0.10) 304.1 - Installing orjson (3.9.15) 304.3 - Installing pmdarima (2.0.4) 304.3 - Installing pydub (0.25.1) 304.3 - Installing pytorch-lightning (2.0.9.post0) 304.4 - Installing pywavelets (1.5.0) 304.5 - Installing querystring-parser (1.2.4) 304.7 - Installing ray (2.6.3) 305.4 - Installing responses (0.18.0) 305.6 - Installing safetensors (0.4.2) 305.9 - Installing scikit-base (0.7.5) 306.9 - Installing semantic-version (2.10.0) 307.2 - Installing sentencepiece (0.2.0) 307.4 - Installing spacy (2.3.9) 307.7 - Installing sqlparse (0.4.4) 308.1 - Installing starsessions (1.3.0) 308.1 - Installing tabulate (0.9.0) 308.2 - Installing tensorboard-data-server (0.7.2) 308.3 - Installing tifffile (2024.2.12) 308.4 - Installing tokenizers (0.13.3) 308.4 - Installing torchvision (0.15.1) 308.6 - Installing tsdownsample (0.1.2) 308.8 - Installing typer (0.9.0) 308.9 - Installing typing-inspect (0.9.0) 309.0 - Installing utilsforecast (0.0.10) 309.1 - Installing watchdog (4.0.0) 309.3 - Installing widgetsnbextension (4.0.10) 309.4 - Installing window-ops (0.0.15) 309.6 - Installing xgboost (2.0.3) 323.7 /usr/local/lib/python3.11/site-packages/ray/dashboard/modules/log/log_agent.py:217: SyntaxWarning: "is not" with a literal. Did you mean "!="? 323.7 keep_alive_interval_sec >= 0 and end_offset is not -1 ------ Dockerfile:18 -------------------- 16 | RUN pip install --no-cache-dir poetry==1.8.2 17 | RUN poetry config virtualenvs.create false 18 | >>> RUN poetry install --only main --compile 19 | 20 | # lastly copy scipts (most likely to change) -------------------- ERROR: failed to solve: process "/bin/sh -c poetry install --only main --compile" did not complete successfully: exit code: 1 ```
abn commented 6 months ago

This looks more like an environment issue than Poetry. The oddities I see, and I cannot comment without verbose logs and also possible a reproducer container, are as follows.

  1. You already seem to be setting virtual env creation to false (please stop doing that even in a container, it is a bad idea and a foot-gun).
    > [13/14] RUN poetry install --only main --compile:                                        
    0.600 Skipping virtualenv creation, as specified in config file.  
virtualenvs.create = false
  1. For what ever reason the run command is detecting that you are using nu shell.
    303.1   FileNotFoundError
    303.1 
    303.1   [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/virtualenv/activation/nushell/activate.nu'
    303.1 

Please provide a concise reproducer.

pascal456 commented 6 months ago

Thanks for having a look!

You already seem to be setting virtual env creation to false (please stop doing that even in a container, it is a bad idea and a foot-gun).

This is what the docs suggest to do.

While Poetry automatically creates virtual environments to always work isolated from the global Python installation, there are valid reasons why it’s not necessary and is an overhead, like when working with containers.

Further, I have set up other projects with poetry and containers are working fine actually. But for whatever reason, the above package installation steps try to activate an virtualenv. I will try to reproduce another example, that is working. Until then, maybe you can make another guess 🙂 ?

For what ever reason the run command is detecting that you are using nu shell.

Yes I was wondering. I am not into the details of poetry, which is why I opened the issue. My first guess or feeling was, that this is due to poetries inner workings.

Please provide a concise reproducer.

Sure 👍, here a full example repo: https://github.com/pascal456/exampleproject I am able to reproduce the error with this minimal setup.

Interestingly, there is no issue when I install with the devcontainer.

pascal456 commented 6 months ago

And here is an example (branch) with a working installation configuration:

https://github.com/pascal456/exampleproject/tree/working-example

The difference lies only in the dependencies (pyproject.toml + corresponding poetry.lock changes): https://github.com/pascal456/exampleproject/commit/58e2f740a025493594adf78bec5c1c137f17f283

abn commented 6 months ago

This is what the docs suggest to do.

While Poetry automatically creates virtual environments to always work isolated from the global Python installation, there are valid reasons why it’s not necessary and is an overhead, like when working with containers.

That should say that is an option that can be used if you "really" want it and you "really" understand what the implications are. The "like when working with containers" really need to be removed. As there is no realistic overhead so to speak off, and most of the time the use cases that need base container packages can simply use the virtualenvs.options.system-site-packages option (I am also aware there are a couple bugs here that needs squashing). And often times than not, you will really end up foot-guning yourself if you disable venvs.

Sure 👍, here a full example repo: https://github.com/pascal456/exampleproject I am able to reproduce the error with this minimal setup.

Thanks for that, much appreciated. We can take a look see what we end up with.

abn commented 6 months ago

The failure is a bit more clearer with verbose logging.

console.log

```console [virtualenv] find interpreter for spec PythonSpec(path=/usr/local/bin/python3.11) [virtualenv] proposed PythonInfo(spec=CPython3.11.8.final.0-64, exe=/usr/local/bin/python3.11, platform=linux, version='3.11.8 (main, Mar 12 2024, 11:52:02) [GCC 12.2.0]', encoding_fs_io=utf-8-utf-8) [virtualenv] accepted PythonInfo(spec=CPython3.11.8.final.0-64, exe=/usr/local/bin/python3.11, platform=linux, version='3.11.8 (main, Mar 12 2024, 11:52:02) [GCC 12.2.0]', encoding_fs_io=utf-8-utf-8) [virtualenv] create virtual environment via CPython3Posix(dest=/tmp/tmp487coft9/.venv, clear=False, no_vcs_ignore=False, global=False) [virtualenv] create folder /tmp/tmp487coft9/.venv/bin [virtualenv] create folder /tmp/tmp487coft9/.venv/lib/python3.11/site-packages [virtualenv] write /tmp/tmp487coft9/.venv/pyvenv.cfg [virtualenv] home = /usr/local/bin [virtualenv] implementation = CPython [virtualenv] version_info = 3.11.8.final.0 [virtualenv] virtualenv = 20.25.1 [virtualenv] include-system-site-packages = false [virtualenv] base-prefix = /usr/local [virtualenv] base-exec-prefix = /usr/local [virtualenv] base-executable = /usr/local/bin/python3.11 [virtualenv] symlink /usr/local/bin/python3.11 to /tmp/tmp487coft9/.venv/bin/python [virtualenv] create virtualenv import hook file /tmp/tmp487coft9/.venv/lib/python3.11/site-packages/_virtualenv.pth [virtualenv] create /tmp/tmp487coft9/.venv/lib/python3.11/site-packages/_virtualenv.py [virtualenv] ============================== target debug ============================== [virtualenv] debug via /tmp/tmp487coft9/.venv/bin/python /usr/local/lib/python3.11/site-packages/virtualenv/create/debug.py [virtualenv] { [virtualenv] "sys": { [virtualenv] "executable": "/tmp/tmp487coft9/.venv/bin/python", [virtualenv] "_base_executable": "/usr/local/bin/python3.11", [virtualenv] "prefix": "/tmp/tmp487coft9/.venv", [virtualenv] "base_prefix": "/usr/local", [virtualenv] "real_prefix": null, [virtualenv] "exec_prefix": "/tmp/tmp487coft9/.venv", [virtualenv] "base_exec_prefix": "/usr/local", [virtualenv] "path": [ [virtualenv] "/usr/local/lib/python311.zip", [virtualenv] "/usr/local/lib/python3.11", [virtualenv] "/usr/local/lib/python3.11/lib-dynload", [virtualenv] "/tmp/tmp487coft9/.venv/lib/python3.11/site-packages" [virtualenv] ], [virtualenv] "meta_path": [ [virtualenv] "", [virtualenv] "", [virtualenv] "", [virtualenv] "" [virtualenv] ], [virtualenv] "fs_encoding": "utf-8", [virtualenv] "io_encoding": "utf-8" [virtualenv] }, [virtualenv] "version": "3.11.8 (main, Mar 12 2024, 11:52:02) [GCC 12.2.0]", [virtualenv] "makefile_filename": "/usr/local/lib/python3.11/config-3.11-x86_64-linux-gnu/Makefile", [virtualenv] "os": "", [virtualenv] "site": "", [virtualenv] "datetime": "", [virtualenv] "math": "", [virtualenv] "json": "" [virtualenv] } [urllib3:urllib3.connectionpool] https://files.pythonhosted.org:443 "GET /packages/f2/91/e5ae454da8200c6eb6cf94ca05d799b51e2cb2cc458a7737aebc0c5a21bb/croniter-1.4.1-py2.py3-none-any.whl HTTP/1.1" 200 19579 [virtualenv] add activators for Bash, CShell, Fish, Nushell, PowerShell, Python Stack trace: 20 /usr/local/lib/python3.11/site-packages/poetry/installation/executor.py:281 in _execute_operation 279│ 280│ try: → 281│ result = self._do_execute_operation(operation) 282│ except EnvCommandError as e: 283│ if e.e.returncode == -2: 19 /usr/local/lib/python3.11/site-packages/poetry/installation/executor.py:391 in _do_execute_operation 389│ return 0 390│ → 391│ result: int = getattr(self, f"_execute_{method}")(operation) 392│ 393│ if result != 0: 18 /usr/local/lib/python3.11/site-packages/poetry/installation/executor.py:516 in _execute_install 514│ 515│ def _execute_install(self, operation: Install | Update) -> int: → 516│ status_code = self._install(operation) 517│ 518│ self._save_url_reference(operation) 17 /usr/local/lib/python3.11/site-packages/poetry/installation/executor.py:554 in _install 552│ archive = self._download_link(operation, Link(package.source_url)) 553│ else: → 554│ archive = self._download(operation) 555│ 556│ operation_message = self.get_operation_message(operation) 16 /usr/local/lib/python3.11/site-packages/poetry/installation/executor.py:746 in _download 744│ self._yanked_warnings.append(message) 745│ → 746│ return self._download_link(operation, link) 747│ 748│ def _download_link(self, operation: Install | Update, link: Link) -> Path: 15 /usr/local/lib/python3.11/site-packages/poetry/installation/executor.py:781 in _download_link 779│ self._write(operation, message) 780│ → 781│ archive = self._chef.prepare(archive, output_dir=original_archive.parent) 782│ 783│ # Use the original archive to provide the correct hash. 14 /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:123 in prepare 121│ return self._prepare(archive, destination=destination, editable=editable) 122│ → 123│ return self._prepare_sdist(archive, destination=output_dir) 124│ 125│ def _prepare( 13 /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:194 in _prepare_sdist 192│ destination.mkdir(parents=True, exist_ok=True) 193│ → 194│ return self._prepare( 195│ sdist_dir, 196│ destination, 12 /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:130 in _prepare 128│ from subprocess import CalledProcessError 129│ → 130│ with ephemeral_environment(self._env.python) as venv: 131│ env = IsolatedEnv(venv, self._pool) 132│ builder = ProjectBuilder.from_isolated_env( 11 /usr/local/lib/python3.11/contextlib.py:137 in __enter__ 135│ del self.args, self.kwds, self.func 136│ try: → 137│ return next(self.gen) 138│ except StopIteration: 139│ raise RuntimeError("generator didn't yield") from None 10 /usr/local/lib/python3.11/site-packages/poetry/utils/env/__init__.py:49 in ephemeral_environment 47│ # TODO: cache PEP 517 build environment corresponding to each project venv 48│ venv_dir = Path(tmp_dir) / ".venv" → 49│ EnvManager.build_venv( 50│ path=venv_dir, 51│ executable=executable, 9 /usr/local/lib/python3.11/site-packages/poetry/utils/env/env_manager.py:678 in build_venv 676│ args.append(str(path)) 677│ → 678│ cli_result = virtualenv.cli_run(args, setup_logging=False) 679│ 680│ # Exclude the venv folder from from macOS Time Machine backups 8 /usr/local/lib/python3.11/site-packages/virtualenv/run/__init__.py:33 in cli_run 31│ with of_session: 32│ of_session.run() → 33│ return of_session 34│ 35│ 7 /usr/local/lib/python3.11/site-packages/virtualenv/run/session.py:46 in run 44│ 45│ def run(self): → 46│ self._create() 47│ self._seed() 48│ self._activate() 6 /usr/local/lib/python3.11/site-packages/virtualenv/run/session.py:65 in _activate 63│ if self.activators: 64│ logging.info( → 65│ "add activators for %s", 66│ ", ".join(type(i).__name__.replace("Activator", "") for i in self.activators), 67│ ) 5 /usr/local/lib/python3.11/site-packages/virtualenv/activation/via_template.py:27 in generate 25│ def generate(self, creator): 26│ dest_folder = creator.bin_dir → 27│ replacements = self.replacements(creator, dest_folder) 28│ generated = self._generate(replacements, self.templates(), dest_folder, creator) 29│ if self.flag_prompt is not None: 4 /usr/local/lib/python3.11/site-packages/virtualenv/activation/via_template.py:44 in _generate 42│ def _generate(self, replacements, templates, to_folder, creator): 43│ generated = [] → 44│ for template in templates: 45│ text = self.instantiate_template(replacements, template, creator) 46│ dest = to_folder / self.as_name(template) 3 /usr/local/lib/python3.11/site-packages/virtualenv/activation/via_template.py:60 in instantiate_template 58│ text = binary.decode("utf-8", errors="strict") 59│ for key, value in replacements.items(): → 60│ value = self._repr_unicode(creator, value) 61│ text = text.replace(key, value) 62│ return text 2 /usr/local/lib/python3.11/site-packages/virtualenv/activation/via_template.py:13 in read_binary 11│ from .activator import Activator 12│ → 13│ if sys.version_info >= (3, 7): 14│ from importlib.resources import read_binary 15│ else: 1 /usr/local/lib/python3.11/pathlib.py:1050 in read_bytes 1048│ Open the file in bytes mode, read it, and close the file. 1049│ """ → 1050│ with self.open(mode='rb') as f: 1051│ return f.read() 1052│ FileNotFoundError [Errno 2] No such file or directory: '/usr/local/lib/python3.11/site-packages/virtualenv/activation/nushell/activate.nu' at /usr/local/lib/python3.11/pathlib.py:1044 in open [urllib3:urllib3.connectionpool] https://files.pythonhosted.org:443 "GET /packages/5a/8f/a9d39ec15f40e8169cb134317824ee4618b864b2e4b91a9b310d3ef94729/deepdiff-6.7.1-py3-none-any.whl HTTP/1.1" 200 76554 1040│ the built-in open() function does. [urllib3:urllib3.connectionpool] https://files.pythonhosted.org:443 "GET /packages/cb/56/f4845ed78723a4eb8eb22bcfcb46e1157a462c78c0a5ed318c68c98f9a79/gdown-5.1.0-py3-none-any.whl HTTP/1.1" 200 17769 1041│ """ 1042│ if "b" not in mode: 1043│ encoding = io.text_encoding(encoding) → 1044│ return io.open(self, mode, buffering, encoding, errors, newline) 1045│ 1046│ def read_bytes(self): 1047│ """ 1048│ Open the file in bytes mode, read it, and close the file. Cannot install ffmpy. ```

The issue happens when the isolated build environment for the sdist build for the dependencies that fail to install run.


  15  /usr/local/lib/python3.11/site-packages/poetry/installation/executor.py:781 in _download_link
       779│             self._write(operation, message)
       780│ 
     → 781│             archive = self._chef.prepare(archive, output_dir=original_archive.parent)
       782│ 
       783│         # Use the original archive to provide the correct hash.

  14  /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:123 in prepare
       121│             return self._prepare(archive, destination=destination, editable=editable)
       122│ 
     → 123│         return self._prepare_sdist(archive, destination=output_dir)
       124│ 
       125│     def _prepare(

  13  /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:194 in _prepare_sdist
       192│             destination.mkdir(parents=True, exist_ok=True)
       193│ 
     → 194│             return self._prepare(
       195│                 sdist_dir,
       196│                 destination,

  12  /usr/local/lib/python3.11/site-packages/poetry/installation/chef.py:130 in _prepare
       128│         from subprocess import CalledProcessError
       129│ 
     → 130│         with ephemeral_environment(self._env.python) as venv:
       131│             env = IsolatedEnv(venv, self._pool)
       132│             builder = ProjectBuilder.from_isolated_env(

  11  /usr/local/lib/python3.11/contextlib.py:137 in __enter__
       135│         del self.args, self.kwds, self.func
       136│         try:
     → 137│             return next(self.gen)
       138│         except StopIteration:
       139│             raise RuntimeError("generator didn't yield") from None

  10  /usr/local/lib/python3.11/site-packages/poetry/utils/env/__init__.py:49 in ephemeral_environment
        47│         # TODO: cache PEP 517 build environment corresponding to each project venv
        48│         venv_dir = Path(tmp_dir) / ".venv"
     →  49│         EnvManager.build_venv(
        50│             path=venv_dir,
        51│             executable=executable,

   9  /usr/local/lib/python3.11/site-packages/poetry/utils/env/env_manager.py:678 in build_venv
       676│         args.append(str(path))
       677│ 
     → 678│         cli_result = virtualenv.cli_run(args, setup_logging=False)
       679│ 
       680│         # Exclude the venv folder from from macOS Time Machine backups
abn commented 6 months ago

I will also note that not disabling virtual environments, works well. The issue here really is likely that the package installation modifying the environment in which poetry is running while it is running.

podman run --rm -i --entrypoint bash -v poetry-cache:/root/.cache/pypoetry docker.io/python:3.11-slim-bookworm <<EOF
set -xe
python -m pip install --disable-pip-version-check -q poetry
poetry config virtualenvs.in-project true
poetry config virtualenvs.options.no-pip true
poetry config virtualenvs.options.no-setuptools true

export DEBIAN_FRONTEND=noninteractive
apt update -qq && apt install -qq -y git-all libgomp1 libffi-dev

git clone https://github.com/pascal456/exampleproject.git /opt/app
pushd /opt/app

#poetry config virtualenvs.create false
poetry install --only main --compile
EOF

Warning: This (used without an existing cache will download around 7GB of data.

console.log

```console + git clone https://github.com/pascal456/exampleproject.git /opt/app Cloning into '/opt/app'... + pushd /opt/app /opt/app / + poetry install --only main --compile Creating virtualenv exampleproject in /opt/app/.venv Installing dependencies from lock file Package operations: 310 installs, 0 updates, 0 removals - Installing pip (24.0) - Installing six (1.16.0) - Installing jmespath (1.0.1) - Installing pyasn1 (0.5.1) - Installing python-dateutil (2.9.0.post0) - Installing urllib3 (2.2.1) - Installing botocore (1.34.67) - Installing cachetools (5.3.3) - Installing certifi (2024.2.2) - Installing charset-normalizer (3.3.2) - Installing cmake (3.28.3) - Installing filelock (3.13.1) - Installing frozenlist (1.4.1) - Installing idna (3.6) - Installing lit (18.1.1) - Installing markupsafe (2.1.5) - Installing mdurl (0.1.2) - Installing mpmath (1.3.0) - Installing multidict (6.0.5) - Installing protobuf (4.25.3) - Installing pyasn1-modules (0.3.0) - Installing rsa (4.9) - Installing setuptools (69.2.0) - Installing sniffio (1.3.1) - Installing wheel (0.43.0) - Installing aiosignal (1.3.1) - Installing anyio (3.7.1) - Installing attrs (23.2.0) - Installing cymem (2.0.8) - Installing google-auth (2.29.0) - Installing googleapis-common-protos (1.63.0) - Installing h11 (0.14.0) - Installing jinja2 (3.1.3) - Installing markdown-it-py (3.0.0) - Installing murmurhash (1.0.10) - Installing networkx (3.2.1) - Installing numpy (1.26.4) - Installing nvidia-cublas-cu11 (11.10.3.66) - Installing nvidia-cuda-cupti-cu11 (11.7.101) - Installing nvidia-cuda-nvrtc-cu11 (11.7.99) - Installing nvidia-cuda-runtime-cu11 (11.7.99) - Installing nvidia-cudnn-cu11 (8.5.0.96) - Installing nvidia-cufft-cu11 (10.9.0.58) - Installing nvidia-curand-cu11 (10.2.10.91) - Installing nvidia-cusolver-cu11 (11.4.0.1) - Installing nvidia-cusparse-cu11 (11.7.4.91) - Installing nvidia-nccl-cu11 (2.14.3) - Installing nvidia-nvtx-cu11 (11.7.91) - Installing packaging (23.2) - Installing pygments (2.17.2) - Installing pytz (2023.4) - Installing requests (2.31.0) - Installing s3transfer (0.10.1) - Installing sympy (1.12) - Installing triton (2.0.0) - Installing typing-extensions (4.10.0) - Installing tzdata (2024.1) - Installing wcwidth (0.2.13) - Installing xmod (1.8.1) - Installing yarl (1.9.4) Installing /opt/app/.venv/lib/python3.11/site-packages/nvidia/__init__.py over existing file Installing /opt/app/.venv/lib/python3.11/site-packages/nvidia/__init__.py over existing file Installing /opt/app/.venv/lib/python3.11/site-packages/nvidia/__init__.py over existing file - Installing aiohttp (3.9.3) - Installing appdirs (1.4.4) - Installing asttokens (2.4.1) - Installing blessed (1.20.0) - Installing blinker (1.7.0) - Installing blis (0.7.11) - Installing boto3 (1.34.67) - Installing catalogue (1.0.2) - Installing click (8.1.7) - Installing contourpy (1.2.0) - Installing cycler (0.12.1) - Installing dill (0.3.7) - Installing distlib (0.3.8) - Installing faker (24.3.0) - Installing fonttools (4.50.0) - Installing executing (2.0.1) - Installing fsspec (2024.3.1) - Installing google-api-core (2.17.1) - Installing greenlet (3.0.3) - Installing httpcore (1.0.4) - Installing itsdangerous (2.1.2) - Installing joblib (1.3.2) - Installing kiwisolver (1.4.5) - Installing lightning-utilities (0.11.0) - Installing llvmlite (0.42.0) - Installing nvidia-ml-py (12.535.133) - Installing opencensus-context (0.1.3) - Installing pandas (2.1.4) - Installing parso (0.8.3) - Installing patsy (0.5.6) - Installing pillow (10.2.0) - Installing plac (1.1.3) - Installing preshed (3.0.9) - Installing psutil (5.9.8) - Installing ptyprocess (0.7.0) - Installing pure-eval (0.2.2) - Installing pydantic (1.10.14) - Installing pyparsing (3.1.2) - Installing pyrsistent (0.20.0) - Installing pysocks (1.7.1) - Installing pyyaml (6.0.1) - Installing rich (13.7.1) - Installing runs (1.2.2) - Installing scipy (1.11.4) - Installing smmap (5.0.1) - Installing soupsieve (2.5) - Installing srsly (1.0.7) - Installing starlette (0.27.0) - Installing tbb (2021.11.0) - Installing tenacity (8.2.3) - Installing threadpoolctl (3.4.0) - Installing torch (2.0.0) - Installing tqdm (4.66.2) - Installing traitlets (5.14.2) - Installing wasabi (0.10.1) - Installing werkzeug (3.0.1) - Installing wrapt (1.16.0) - Installing zipp (3.18.1) - Installing aiohttp-cors (0.7.0) - Installing autogluon-common (1.0.0) - Installing beautifulsoup4 (4.12.3) - Installing cloudpickle (3.0.0) - Installing colorama (0.4.6) - Installing colorful (0.5.6) - Installing cython (3.0.9) - Installing daal (2024.1.0) - Installing dash-core-components (2.0.0) - Installing dash-html-components (2.0.0) - Installing dash-table (5.0.0) - Installing decorator (5.1.1) - Installing distro (1.9.0) - Installing editor (1.6.6) - Installing fastapi (0.104.1) - Installing fastcore (1.5.29) - Installing fastprogress (1.0.3) - Installing flask (3.0.2) - Installing future (1.0.0) - Installing gitdb (4.0.11) - Installing gpustat (1.1.1) - Installing graphviz (0.20.3) - Installing grpcio (1.62.1) - Installing httpx (0.27.0) - Installing huggingface-hub (0.21.4) - Installing importlib-metadata (7.1.0) - Installing jedi (0.19.1) - Installing jsonschema (4.17.3) - Installing mako (1.3.2) - Installing markdown (3.6) - Installing matplotlib (3.7.5) - Installing matplotlib-inline (0.1.6) - Installing msgpack (1.0.8) - Installing msgspec (0.18.6) - Installing multiprocess (0.70.15) - Installing mypy-extensions (1.0.0) - Installing nest-asyncio (1.6.0) - Installing numba (0.59.1) - Installing opencensus (0.11.4) - Installing openxlab (0.0.11) - Installing ordered-set (4.1.0) - Installing pexpect (4.9.0) - Installing platformdirs (4.2.0) Installing /opt/app/.venv/lib/python3.11/site-packages/opencensus/__init__.py over existing file Installing /opt/app/.venv/lib/python3.11/site-packages/opencensus/common/__init__.py over existing file - Installing plotly (5.20.0) - Installing polyfactory (2.15.0) - Installing prometheus-client (0.20.0) - Installing prompt-toolkit (3.0.43) - Installing py-spy (0.3.14) - Installing py4j (0.10.9.7) - Installing pyarrow (14.0.2) - Installing pycryptodome (3.20.0) - Installing pyjwt (2.8.0) - Installing python-multipart (0.0.9) - Installing readchar (4.0.6) - Installing regex (2023.12.25) - Installing retrying (1.3.4) - Installing rich-click (1.7.4) - Installing scikit-learn (1.4.1.post1) - Installing smart-open (7.0.3) - Installing sqlalchemy (2.0.28) - Installing stack-data (0.6.3) - Installing statsmodels (0.14.1) - Installing tensorboardx (2.6.2.2) - Installing thinc (7.4.6) - Installing toolz (0.12.1) - Installing torchmetrics (1.1.2) - Installing types-python-dateutil (2.9.0.20240316) - Installing uvicorn (0.29.0) - Installing virtualenv (20.4.7) - Installing websocket-client (1.7.0) - Installing websockets (11.0.3) - Installing xxhash (3.4.1) - Installing absl-py (2.1.0) - Installing aiofiles (23.2.1) - Installing alembic (1.13.1) - Installing altair (5.2.0) - Installing arrow (1.3.0) - Installing async-timeout (4.0.3) - Installing autogluon-core (1.0.0) - Installing autogluon-features (1.0.0) - Installing antlr4-python3-runtime (4.9.3) - Installing backoff (2.2.1) - Installing comm (0.2.2) - Installing catboost (1.2.3) - Installing datasets (2.14.4) - Installing daal4py (2024.1.0) - Installing dash (2.16.1) - Installing dateutils (0.6.12) - Installing deepdiff (6.7.1) - Installing croniter (1.4.1) - Installing docker (7.0.0) - Installing dynaconf (3.2.5) - Installing entrypoints (0.4) - Installing fastdownload (0.0.7) - Installing fastjsonschema (2.19.1) - Installing ffmpy (0.3.2) - Installing gdown (5.1.0) - Installing gitpython (3.1.42) - Installing gradio-client (0.6.1) - Installing gunicorn (21.2.0) - Installing hyperopt (0.2.7) - Installing imageio (2.34.0) - Installing importlib-resources (6.3.2) - Installing inquirer (3.2.4) - Installing ipython (8.22.2) - Installing iterative-telemetry (0.0.8) - Installing jupyter-core (5.7.2) - Installing jupyterlab-widgets (3.0.10) - Installing lazy-loader (0.3) - Installing lightgbm (4.1.0) - Installing lightning-cloud (0.5.65) - Installing litestar (2.7.0) - Installing model-index (0.1.11) - Installing nltk (3.8.1) - Installing opendatalab (0.0.10) - Installing orjson (3.9.15) - Installing pmdarima (2.0.4) - Installing pydub (0.25.1) - Installing pytorch-lightning (2.0.9.post0) - Installing pywavelets (1.5.0) - Installing querystring-parser (1.2.4) - Installing ray (2.6.3) - Installing responses (0.18.0) - Installing safetensors (0.4.2) - Installing scikit-base (0.7.5) - Installing semantic-version (2.10.0) - Installing sentencepiece (0.2.0) - Installing spacy (2.3.9) - Installing sqlparse (0.4.4) - Installing starsessions (1.3.0) - Installing tabulate (0.9.0) - Installing tensorboard-data-server (0.7.2) - Installing tifffile (2024.2.12) - Installing tokenizers (0.13.3) - Installing torchvision (0.15.1) - Installing tsdownsample (0.1.2) - Installing typer (0.9.0) - Installing typing-inspect (0.9.0) - Installing utilsforecast (0.0.10) - Installing watchdog (4.0.0) - Installing widgetsnbextension (4.0.10) - Installing window-ops (0.0.15) - Installing xgboost (2.0.3) /opt/app/.venv/lib/python3.11/site-packages/ray/dashboard/modules/log/log_agent.py:217: SyntaxWarning: "is not" with a literal. Did you mean "!="? keep_alive_interval_sec >= 0 and end_offset is not -1 - Installing accelerate (0.21.0) - Installing autogluon-tabular (1.0.0) - Installing category-encoders (2.6.3) - Installing defusedxml (0.7.1) - Installing deprecation (2.1.0) - Installing evaluate (0.4.1) - Installing evidently (0.4.17) - Installing fastai (2.7.14) - Installing gluonts (0.14.4) - Installing gradio (3.50.2) - Installing imbalanced-learn (0.12.0) - Installing ipywidgets (8.1.2) - Installing kaleido (0.2.1) - Installing kmodes (0.12.2) - Installing lightning (2.0.9.post0) - Installing m2cgen (0.10.0) - Installing mlflow (2.10.2) - Installing mlforecast (0.10.0) - Installing nbformat (5.10.3) - Installing mlxtend (0.23.1) - Installing nlpaug (1.1.11) - Installing nptyping (2.4.1) - Installing nvidia-ml-py3 (7.352.0) Installing /opt/app/.venv/lib/python3.11/site-packages/pynvml.py over existing file - Installing omegaconf (2.2.3) - Installing openmim (0.3.9) - Installing plotly-resampler (0.9.2) - Installing pyod (1.1.3) - Installing pytesseract (0.3.10) - Installing pytorch-metric-learning (1.7.3) - Installing schemdraw (0.15) - Installing scikit-image (0.20.0) - Installing scikit-learn-intelex (2024.1.0) - Installing scikit-plot (0.3.7) - Installing seqeval (1.2.2) - Installing sktime (0.27.0) - Installing statsforecast (1.4.0) - Installing tbats (1.1.3) - Installing tensorboard (2.16.2) - Installing text-unidecode (1.3) - Installing timm (0.9.16) - Installing transformers (4.31.0) - Installing wurlitzer (3.0.3) - Installing yellowbrick (1.5) Installing /opt/app/.venv/lib/python3.11/site-packages/docs/source/conf.py over existing file - Installing autogluon-multimodal (1.0.0) - Installing autogluon-timeseries (1.0.0) - Installing pycaret (3.3.0) - Installing autogluon (1.0.0) - Installing fhdw-modelling (7.2.0) - Installing redis (5.0.3) Installing the current project: exampleproject (0.0.1) ```

pascal456 commented 6 months ago

I have found a workaround to achieve what I am looking for.

Originally I wanted to have a folder / project structure like:

.
├── package
├── processes
│   └── examplescript.py
.
.

so that I could run the container somelike in the following

docker run --rm examplepackage:latest processes/examplescript.py -h

Now that the global python does not hold the packages anymore, when having to create a virtual env, I cannot run the scripts just with the previous

ENTRYPOINT [ "python" ]

I had to change this to the following now:

To activate the environment I could change the ENTRYPOINT to do a poetry run, but in that case I was struggling with access rights. Therefore I changed the package structure like in the following:

├── package
│   ├── __init__.py
│   ├── processes
│   │   ├── __init_.py
│   │   └── examplescript.py

adapted the ENTRYPOINT in the Dockerfile:

ENTRYPOINT [ "poetry", "run", "python", "-m", "package.processes.examplescript" ]
CMD [ "-h" ]

and can now run it with

docker run --rm exampleproject:latest

which directly runs the script. This is working for now.

Full Dockerfile:

```Dockerfile FROM python:3.11-slim-bookworm RUN apt update RUN apt install -y git-all libgomp1 RUN apt clean # Essentials WORKDIR /app COPY ./package ./package COPY setup.cfg . COPY pyproject.toml . COPY poetry.lock . COPY README.md . # install package and dependencies RUN python -m pip install --no-cache-dir poetry==1.8.2 RUN poetry config virtualenvs.in-project true RUN poetry install --only main --compile ENTRYPOINT [ "poetry", "run", "python", "-m", "package.processes.examplescript" ] CMD [ "-h" ] ```

Discussion: I am not 100% pleased with this solution. Maybe this is a matter of taste but when working with containers I always think of the container as a whole as the isolated portion of my code. Having to add an additional virtual env inside the container feels like overhead to me or let's say like something double. Is this really the intended use case here? Since I first totally identified with the statement from the docs saying there are valid reasons why it’s not necessary and is an overhead, like when working with containers. This is actually my very use case here. For example the next step could now be to add another script, but I would like to reuse this environment / Dockerfile; then I would have to build the container again (maybe different Tag) or alternatively change the Entrypoint again, so that I give the -m package.processes.script portion of the docker run command.

Maybe there is a more neat or artful way of solving this, like I did. How would you solve this use case of running a script ?

abn commented 5 months ago

Now that the global python does not hold the packages anymore, when having to create a virtual env, I cannot run the scripts just with the previous

You can just do

ENTRYPOINT ["/app/.venv/bin/python"]

Or you can add the env activation into your shell profile. Alternatively, you can also prepend the virtualenv path as well.

ENV PATH="/app/.venv/bin:$PATH"

This will let you keep the previous entrypoint, or even better use a shell/bash entrypoint and load your "examplescript" as an entrypoint console script in your poetry project :) Getting you something like this.

docker run --rm examplepackage:latest example-script -h

Maybe this is a matter of taste but when working with containers I always think of the container as a whole as the isolated portion of my code. Having to add an additional virtual env inside the container feels like overhead to me or let's say like something double.

This is a common misconception imho. Also the "default" site inside most containers are externally managed and should not installed to via pip or poetry etc.

And the only real overhead aer some directories being created to contain the specific set of dependencies you need for your project, and for you get some really nice benefits.

Once again, I would strongly urge that virtual environments be always used, even within containers.

Also, in your case you might want to consider using cache mounts for your builds. For both the apt caches as well as /root/.cache/pypoetry.

pascal456 commented 4 weeks ago

Followed your suggestion, and I am using virtual environments in containers now. You are right, the technical overhead is negligible, it was more about understanding it properly.

Sorry for late feedback. Very helpful hints on cache mounts and the 'externally managed python environments' terminology. Thank you very much.