Fix pyhost.cpp so that it can be compatible with virtualenv