New submission from Richard Oudkerk <shibt...@gmail.com>:

For Unix I follow the practice suggested in README of running configure from a 
subdir of the main python directory, eg

    mkdir release
    cd release
    ../configure
    make

But if I create a venv then I cannot use it to compile C extensions because the 
include dirs are wrong, eg

    running build
    running build_ext
    building 'demo' extension
    gcc -pthread -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -fPIC -I/home/user/Repos/cpython/release/Include 
-I/home/user/Repos/cpython/release -c demo.c -o build/temp.linux-i686-3.3/demo.o
    demo.c:1:20: fatal error: Python.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1

The problem seems to be that distutils.sysconfig.get_python_inc() assumes that 
if sys._home is set (as it is in a virtual env) then the standard header files 
can be found in sys._home + '/Include'.

But for my venv this is wrong, since sys._home is 
"/home/user/Repos/cpython/release" and 
"/home/user/Repos/cpython/release/Include" is empty.  Instead get_python_inc() 
should return "/home/user/Repos/cpython/Include".

BTW, a seperate issue seems to be that ${venv}/include is not added to the list 
of include dirs used when compiling.

----------
components: Library (Lib)
messages: 165589
nosy: sbt, vinay.sajip
priority: normal
severity: normal
stage: needs patch
status: open
title: venv assumes header files in sys._home + '/Include'
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15366>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to