Tzu-ping Chung <> added the comment:

@cosven you are correct! I made some additional observation while working on 
adding venv support to pew, in this thread: I’ll try to summarise below.

The root problem is indeed virtualenv’s custom site module, but even then it is 
possible for venv (or any tool built around it) to know where the “original” 
Python is, since virtualenv stores the old sys.prefix in sys.real_prefix. 
Unfortunately, however, this is not as useful as it seems. What we really want 
in this situation is sys.exec_prefix, which may or may not be the same as 
sys.prefix. I did manage to cobble together a hack, but it is by no means 

To actually deal with this problem, we will need to amend the site module 
provided by virtualenv, as you mentioned. But this still can’t “solve” it. 
Since the site module is vendored in the produced virtualenv, existing 
virtualenvs will stay broken even after we managed to upgrade the virtualenv 


Python tracker <>
Python-bugs-list mailing list

Reply via email to