ModuleNotFoundError: No module named 'pkgconfig'
pkgconfig: using system package; SPKG will not be installed
sage: attach(‘/somepath/somefile.pyx')
Compiling /somepath/somefile.pyx...
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
File sage/misc/cachefunc.pyx:1019, in sage.misc.cachefunc.CachedFunction.__call__()
KeyError: ((), ())
During handling of the above exception, another exception occurred:
ModuleNotFoundError Traceback (most recent call last)
Cell In[3], line 1
----> 1 sage.repl.load.load(sage.repl.load.base64.b64decode("L1VzZXJzL2Rjb3VkZXJ0L0NvZGUvdGVsYWdyby9wZXJjb2xhdGlvbi5weXg="),globals(),True)
File ~/sage/src/sage/repl/load.py:293, in load(filename, globals, attach)
291 if attach:
292 add_attached_file(fpath)
--> 293 exec(load_cython(fpath), globals)
294 elif ext in ['.f', '.f90']:
295 from sage.misc.inline_fortran import fortran
File ~/sage/src/sage/repl/load.py:71, in load_cython(name)
58 """
59 Helper function to load a Cython file.
60
(...)
68 module.
69 """
70 from sage.misc.cython import cython
---> 71 mod, dir = cython(str(name), compile_message=True, use_cache=True)
72 import sys
73 sys.path.append(dir)
File ~/sage/src/sage/misc/cython.py:354, in cython(filename, verbose, compile_message, use_cache, create_local_c_file, annotate, view_annotate, view_annotate_callback, sage_namespace, create_local_so_file)
350 shutil.copy(filename, pyxfile)
352 # Add current working directory to includes. This is needed because
353 # we cythonize from a different directory. See Issue #24764.
--> 354 standard_libs, standard_libdirs, standard_includes, aliases = _standard_libs_libdirs_incdirs_aliases()
355 includes = [os.getcwd()] + standard_includes
357 # Now do the actual build, directly calling Cython and distutils
File sage/misc/cachefunc.pyx:1024, in sage.misc.cachefunc.CachedFunction.__call__()
File ~/sage/src/sage/misc/cython.py:52, in _standard_libs_libdirs_incdirs_aliases()
38 @cached_function
39 def _standard_libs_libdirs_incdirs_aliases():
40 r"""
41 Return the list of libraries and library directories.
42
(...)
50 {...})
51 """
---> 52 aliases = cython_aliases()
53 standard_libs = [
54 'mpfr', 'gmp', 'gmpxx', 'pari', 'm',
55 'ec', 'gsl',
56 ] + aliases["CBLAS_LIBRARIES"] + [
57 'ntl']
58 standard_libdirs = []
File ~/sage/src/sage/env.py:397, in cython_aliases(required_modules, optional_modules)
345 """
346 Return the aliases for compiling Cython code. These aliases are
347 macros which can occur in ``# distutils`` headers.
(...)
393 435
394 """
395 import itertools
--> 397 import pkgconfig
399 if required_modules is None:
400 required_modules = default_required_modules
ModuleNotFoundError: No module named 'pkgconfig'
sage:
--
You received this message because you are subscribed to the Google Groups "sage-release" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-release...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sage-release/5bfe4fc4-b95c-47e2-aa45-01d26ed2424fn%40googlegroups.com.
Thank you for this new beta version.Good news: I have been able to successfully install this beta on macOS 15.7.1 with upgraded homebrew.As usual, I did (in a fresh shell)make distclean./bootstrapsource .homebrew-build-env./configure --enable-system-site-packages --with-python=`which python3.13` --with-system-jupyter_core=no --with-system-platformdirs=nomake build -j4Bad news: I have some issues## issue 1In a sage console, I triedsage: attach(’somefile.pyx’)
If fails with import error for pkgconfig (see below for complete output)ModuleNotFoundError: No module named 'pkgconfig'
I don’t understand why as the output of configure was:pkgconfig: using system package; SPKG will not be installed
running `sage -pip install pkgconfig` fixes the issue.## issue 2I tried to install tdlib usingmake sagemath_tdlib./sage -i tdlib./sage -i sagemath_tdlib./sage -pip install sagemath-tdlibThe 4 commands are successful, but the result is always the same: feature tdlib is not detected.I opened issue https://github.com/sagemath/sage/issues/41065
To view this discussion visit https://groups.google.com/d/msgid/sage-release/6E06C47B-2BC4-40E3-809F-40B69A92519C%40gmail.com.
Le 18 oct. 2025 à 21:20, Dima Pasechnik <dim...@gmail.com> a écrit :On Sat, Oct 18, 2025 at 8:23 AM David Coudert <david....@gmail.com> wrote:Thank you for this new beta version.Good news: I have been able to successfully install this beta on macOS 15.7.1 with upgraded homebrew.As usual, I did (in a fresh shell)make distclean./bootstrapsource .homebrew-build-env./configure --enable-system-site-packages --with-python=`which python3.13` --with-system-jupyter_core=no --with-system-platformdirs=nomake build -j4Bad news: I have some issues## issue 1In a sage console, I triedsage: attach(’somefile.pyx’)I tried this with a toy (just one Python function) ’somefile.pyx’ and it just worked.I guess we might need true reproducer of this from you.If fails with import error for pkgconfig (see below for complete output)ModuleNotFoundError: No module named 'pkgconfig'I don’t understand why as the output of configure was:pkgconfig: using system package; SPKG will not be installedPrior to "sage -pip install pkgconfig", did "import pkgconfig" work at the Sage prompt?If it did, we probably have one of these "build isolation vs no build isolation" stuff going on.
MAC-xxxx:sage dcoudert$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.8.beta7, Release Date: 2025-10-16 │
│ Using Python 3.13.9. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: import pkgconfig
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import pkgconfig
ModuleNotFoundError: No module named 'pkgconfig'
sage:
MAC-xxxx:sage dcoudert$ grep pkgconf config.log
## Checking whether SageMath should install SPKG pkgconfig... ##
real_configure:80680: checking for python package pkgconfig ()
real_configure:80736: will use system package and not install SPKG pkgconfig
real_configure:155665: result: pkgconfig: using system package; SPKG will not be installed
config.status:4307: creating directory local/lib/pkgconfig
ac_cv_env_PKG_CONFIG_PATH_value=/opt/homebrew/opt/zlib/lib/pkgconfig:/opt/homebrew/opt/sqlite/lib/pkgconfig:/opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/openssl/lib/pkgconfig:/opt/homebrew/opt/openblas/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:
pkg_cv_OPENBLASPCDIR=/opt/homebrew/opt/openblas/lib/pkgconfig
pkgconfig \
pkgconfig \
pkgconfig \
pkgconfig \
OPENBLASPCDIR='/opt/homebrew/opt/openblas/lib/pkgconfig'
PKG_CONFIG_PATH='/opt/homebrew/opt/zlib/lib/pkgconfig:/opt/homebrew/opt/sqlite/lib/pkgconfig:/opt/homebrew/opt/readline/lib/pkgconfig:/opt/homebrew/opt/openssl/lib/pkgconfig:/opt/homebrew/opt/openblas/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:'
SAGE_PKG_CONFIG_PATH='$SAGE_LOCAL/lib/pkgconfig'
deps_cvxopt = numpy $(BLAS) gsl glpk suitesparse | $(PYTHON_TOOLCHAIN) pkgconfig $(PYTHON) $(and $(filter-out no,$(SAGE_CHECK_cvxopt)), matplotlib pytest)
deps_numpy = $(BLAS) gfortran | $(PYTHON_TOOLCHAIN) pkgconfig cython meson_python $(PYTHON)
deps_pkgconfig = | $(PYTHON_TOOLCHAIN) $(PYTHON)
deps_sage_setup = cython pkgconfig jinja2 $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/*.py $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/autogen/interpreters/internal/specs/*.py $(SAGE_ROOT)/pkgs/sage-setup/sage_setup/command/*.py | $(PYTHON_TOOLCHAIN) $(PYTHON)
deps_sagelib = FORCE $(SCRIPTS) boost_cropped $(BLAS) brial cliquer cypari cysignals cython ecl eclib ecm flint libgd gap givaro glpk gmpy2 gsl iml importlib_metadata importlib_resources jupyter_core lcalc lrcalc_python libbraiding libhomfly libpng linbox m4ri m4rie memory_allocator mpc mpfi mpfr $(MP_LIBRARY) ntl numpy pari pip pkgconfig planarity ppl pplpy primesieve primecount primecountpy $(PYTHON) requests rw singular symmetrica typing_extensions $(PCFILES) | $(PYTHON_TOOLCHAIN) meson_python $(PYTHON) pythran
deps_sagemath_bliss = bliss cysignals | $(PYTHON_TOOLCHAIN) sage_setup sagemath_environment cython pkgconfig $(PYTHON)
deps_sagemath_categories = sagemath_objects | $(PYTHON_TOOLCHAIN) sagemath_environment sage_setup cython pkgconfig python_build $(PYTHON) $(and $(filter-out no,$(SAGE_CHECK_sagemath_categories)), tox sagemath_repl)
deps_sagemath_coxeter3 = coxeter3 | $(PYTHON_TOOLCHAIN) sage_setup sagemath_environment cython pkgconfig $(PYTHON)
deps_sagemath_mcqd = mcqd memory_allocator cysignals | $(PYTHON_TOOLCHAIN) sage_setup cython pkgconfig $(PYTHON)
deps_sagemath_meataxe = meataxe cysignals | $(PYTHON_TOOLCHAIN) sage_setup sagemath_environment cython pkgconfig $(PYTHON)
deps_sagemath_objects = FORCE cysignals gmpy2 | $(PYTHON_TOOLCHAIN) sagemath_environment sage_setup cython pkgconfig python_build $(PYTHON) $(and $(filter-out no,$(SAGE_CHECK_sagemath_objects)), tox)
deps_sagemath_sirocco = sirocco cypari cysignals mpfr | $(PYTHON_TOOLCHAIN) sage_setup sagemath_environment cython pkgconfig $(PYTHON)
deps_sagemath_tdlib = tdlib cysignals boost_cropped | $(PYTHON_TOOLCHAIN) sage_setup sagemath_environment cython pkgconfig $(PYTHON)
trees_pkgconfig = SAGE_VENV
vers_pkgconfig = 1.5.5
running `sage -pip install pkgconfig` fixes the issue.## issue 2I tried to install tdlib usingmake sagemath_tdlib./sage -i tdlib./sage -i sagemath_tdlib./sage -pip install sagemath-tdlibThe 4 commands are successful, but the result is always the same: feature tdlib is not detected.I opened issue https://github.com/sagemath/sage/issues/41065I gather that the installation has never actually been tried. See https://github.com/sagemath/sage/issues/41065for details.Dima
sage: attach(‘/somepath/somefile.pyx')Compiling /somepath/somefile.pyx...---------------------------------------------------------------------------KeyError Traceback (most recent call last)File sage/misc/cachefunc.pyx:1019, in sage.misc.cachefunc.CachedFunction.__call__()KeyError: ((), ())During handling of the above exception, another exception occurred:ModuleNotFoundError Traceback (most recent call last)Cell In[3], line 1
----> 1sage.repl.load.load(sage.repl.load.base64.b64decode("L1VzZXJzL2Rjb3VkZXJ0L0NvZGUvdGVsYWdyby9wZXJjb2xhdGlvbi5weXg="),globals(),True)