def add_to_path(pyversion, arch): from _system_path import (add_to_system_path, get_previous_install_prefixes, broadcast_environment_settings_change) # If a previous Anaconda install attempt to this location left remnants, # remove those. remove_from_path(ROOT_PREFIX) # If a previously registered Anaconda install left remnants, remove those. try: old_prefixes = get_previous_install_prefixes(pyversion, arch, allusers) except IOError: old_prefixes = [] for prefix in old_prefixes: out('Removing old installation at %s from PATH (if any entries get found)\n' % (prefix)) remove_from_path(prefix) # add Anaconda to the path add_to_system_path([ os.path.normpath(os.path.join(ROOT_PREFIX, path_suffix)) for path_suffix in PATH_SUFFIXES ], allusers) broadcast_environment_settings_change()
def add_to_path(): from _system_path import (add_to_system_path, remove_from_system_path, broadcast_environment_settings_change) # if previous Anaconda installs left remnants, remove those remove_from_system_path(sys.prefix, allusers) remove_from_system_path(join(sys.prefix, 'Scripts'), allusers) # add Anaconda to the path add_to_system_path([sys.prefix, join(sys.prefix, 'Scripts')], allusers) broadcast_environment_settings_change()
def add_anaconda_to_path(): from _system_path import (add_to_system_path, remove_from_system_path, broadcast_environment_settings_change) # if previous Anaconda installs left remnants, remove those remove_from_system_path(sys.prefix, allusers) remove_from_system_path(join(sys.prefix, 'Scripts'), allusers) # add Anaconda to the path add_to_system_path([sys.prefix, join(sys.prefix, 'Scripts')], allusers) broadcast_environment_settings_change()
def add_to_path(pyversion, arch): from _system_path import (add_to_system_path, get_previous_install_prefixes, broadcast_environment_settings_change) # If a previous Anaconda install attempt to this location left remnants, # remove those. remove_from_path(ROOT_PREFIX) # If a previously registered Anaconda install left remnants, remove those. try: old_prefixes = get_previous_install_prefixes(pyversion, arch, allusers) except IOError: old_prefixes = [] for prefix in old_prefixes: out('Removing old installation at %s from PATH (if any entries get found)\n' % (prefix)) remove_from_path(prefix) # add Anaconda to the path add_to_system_path([os.path.normpath(os.path.join(ROOT_PREFIX, path_suffix)) for path_suffix in PATH_SUFFIXES], allusers) broadcast_environment_settings_change()