libdist: fallback if site.getsitepackages() is unavailable
@@ -122,7 +122,12 @@ else:
# -------------- pip ----------------------
import site
+ try:
SITE_PACKAGES_FOLDER = site.getsitepackages()[0]
+ except AttributeError:
+ # site.getsitepackages() unavalaible in virtualenv
+ import stash
+ SITE_PACKAGES_FOLDER = os.path.dirname(stash.__path__)
SITE_PACKAGES_FOLDER_6 = None
BUNDLED_MODULES = [
