missing-import when importing C extension modules w/o stubs
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the Bug
I'm seeing this issue on macOS 26.1.
I don't think I can add dependencies in the Pyrefly Sandbox, so here are steps to reproduce:
```zsh
$ uv init example && cd example
Initialized project `example` at `/private/tmp/example`
$ uv add pyahocorasick pyrefly
Using CPython 3.14.0
Creating virtual environment at: .venv
Resolved 3 packages in 21ms
Installed 2 packages in 3ms
+ pyahocorasick==2.2.0
+ pyrefly==0.44.1
$ echo "import ahocorasick; print(ahocorasick)" > main.py
$ uv run main.py
$ uv run pyrefly check
INFO Found `/private/tmp/example/pyproject.toml` marking project root, checking root directory with default configuration
ERROR Could not find import of `ahocorasick` [missing-import]
--> main.py:1:8
|
1 | import ahocorasick; print(ahocorasick)
| ^^^^^^^^^^^
|
Looked in these locations (from default config for project root marked by `/private/tmp/example/pyproject.toml`):
Import root (inferred from project layout): "/private/tmp/example"
Site package path queried from interpreter: ["/Users/user/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14", "/Users/user/.local/share/uv/python/cpython-3.14.0-macos-aarch64-none/lib/python3.14/lib-dynload", "/private/tmp/example/.venv/lib/python3.14/site-packages"]
INFO 1 error
```
### Sandbox Link
_No response_
### (Only applicable for extension issues) IDE Information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.