Skip to content

[BUG] cimport of editable-installed pxd dependencies does not work #7326

Open

Description

@cpcloud

Describe the bug

Say I have a package, mainpkg, that depends on a pxd file, test.pxd in another package, deppkg, like this

from deppkg.test cimport Test

where deppkg/test.pxd is:

cdef class Test:
	int x

If I install deppkg as editable, using pip install -e deppkg, and then try to run

pip install mainpkg --no-build-isolation

(--no-build-isolation is necessary because I need the pxd file at build time), Cython fails to find deppkg/test.pxd with this error

Error compiling Cython file:
------------------------------------------------------------
...
from deppkg.test cimport Test
^
------------------------------------------------------------
mainpkg/test.pyx:1:0: 'deppkg/test.pxd' not found
Compiling ./mainpkg/test.pyx because it changed.
[1/1] Cythonizing ./mainpkg/test.pyx

If I install deppkg without the -e flag, I can build mainpkg.

Code to reproduce the behaviour:

It's all in the repo at https://github.com/cpcloud/cython-editable-bug

Expected behaviour

I would expect the build-time behavior of a dependency to be not dependent on whether a package is installed editably or not.

OS

Linux

Python version

3.14

Cython version

3.2.1

Additional context

No response

Activity

  1. changed the title [-][BUG] cimport of editable-installed pxd dependencies do not work[/-] [+][BUG] cimport of editable-installed pxd dependencies does not work[/+] on Nov 14, 2025
  2. vyasr commented on Nov 14, 2025

    @vyasr
    Contributor

    cf. #5855

    Similar issues, although whether the specific limitation is sys.meta_path or sys.path_hooks related depends on your build backend and how it implements editable installs.

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