Skip to content

Python 3.15 from conda-forge: "Could not find Python library" because libpython is not installed #838

Closed

Description

@MilesCranmerBot

With CondaPkg's default environment, PythonCall 0.9.36 fails to load once the solver picks conda-forge's python 3.15.0 (published 2026-10-09):

ERROR: InitError: Could not find Python library for Python executable ".../.CondaPkg/.pixi/envs/default/bin/python".

Cause. Starting with 3.15, conda-forge's python package neither contains nor depends on the shared library; it moved to a separate libpython package (conda-forge/python-feedstock#843). The 3.11 to 3.14 builds still depend on libpython exactly, so they are unaffected. In a 3.15 environment lib/ has no libpython* file at all, so find_libpython.py --list-all prints nothing, although sysconfig still reports LDLIBRARY = libpython3.15.so.

Reproduction (Linux x86_64, Julia 1.13.1). A project whose CondaPkg.toml is

[deps]
python = ">=3.15"

fails on using PythonCall with the error above. Adding

libpython = ""

to the same file fixes it: pyimport("sys").version reports 3.15.0 | packaged by conda-forge.

Possible fix. PythonCall could request libpython itself, but not unconditionally. Every conda-forge libpython build requires libstdcxx >=15, and CondaPkg caps libstdcxx below 15 on Julia versions that bundle an older libstdc++ (seen with 1.10 and 1.12), so an explicit libpython makes the environment unsolvable there. Those Julia versions cannot install python 3.15 anyway, and the older python they get still ships the library. conda-forge also publishes libpython only for 3.11 and newer. In the meantime, SymbolicRegression.jl pins python = "<3.15" in its test environment.

This showed up in SymbolicRegression.jl CI (test group integration/ext/pythoncall).

Activity

  1. cjdoris commented on Oct 11, 2026

    @cjdoris
    Member

    Yep there's a fix for this coming but it requires a new feature in CondaPkg first to depend on libpython conditionally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions