#NEWLINE# def validate_environment( self ) : #NEWLINE# #INDENT# "\n        Make sure :data:`sys.prefix` matches ``$VIRTUAL_ENV`` (if defined).\n\n        This may seem like a strange requirement to dictate but it avoids hairy\n        issues like `documented here <https://github.com/paylogic/pip-accel/issues/5>`_.\n\n        The most sneaky thing is that ``pip`` doesn't have this problem\n        (de-facto) because ``virtualenv`` copies ``pip`` wherever it goes...\n        (``pip-accel`` on the other hand has to be installed by the user).\n        " #NEWLINE# environment = os . environ . get ( 'VIRTUAL_ENV' ) #NEWLINE# if self : #NEWLINE# #INDENT# if ( not same_directories ( sys . prefix , environment ) ) : #NEWLINE# #INDENT# raise EnvironmentMismatchError ( "\n                    You are trying to install packages in environment #1 which\n                    is different from environment #2 where pip-accel is\n                    installed! Please install pip-accel under environment #1 to\n                    install packages there.\n\n                    Environment #1: {environment} (defined by $VIRTUAL_ENV)\n\n                    Environment #2: {prefix} (Python's installation prefix)\n                " , environment = environment , prefix = sys . prefix )