Skip to content

include "Python.h" fails in virtual environments managed by uv and conda due to wrong include path #720

Closed Answered by johannes-mueller
johannes-mueller asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks to @dnicolodi and @eli-schwartz.

Yeah, as it turns out is is a broken uv installation. My ~/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/pkgconfig/python-3.13.pc looks like this

# See: man pkg-config
prefix=/install
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Python
Description: Build a C extension for Python
Requires:
Version: 3.13
Libs.private: -lpthread -ldl  -lutil
Libs: -L${libdir} 
Cflags: -I${includedir}/python3.13

with the prefix=/install leading to the -I/install

Reinstalling uv from scratch helped.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by johannes-mueller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants