use sys.platform to detect OS
fix virtualenv support