Ejemplo n.º 1
0
def pip_install(package_name):
    hide_splash_if_necessary()

    if executable_is_in_path('pip'):
        cmd = '%s install' % shell_escape(get_executable_path('pip'))
    else:
        cmd = shell_escape(sys.executable) + ' -m pip install'
    return run_install_command_as_root(has_qt(), cmd, package_name)
Ejemplo n.º 2
0
def linux_debian_install(package_name):
    qt = qt_available()
    try:
        import apt
        import apt_pkg
    except ImportError:
        qt = False
    hide_splash_if_necessary()

    if qt:
        cmd = shell_escape(vistrails_root_directory() +
                           '/gui/bundles/linux_debian_install.py')
    else:
        cmd = '%s install -y' % (
            'aptitude' if executable_is_in_path('aptitude') else 'apt-get')

    return run_install_command(qt, cmd, package_name)
Ejemplo n.º 3
0
def linux_debian_install(package_name):
    qt = qt_available()
    try:
        import apt
        import apt_pkg
    except ImportError:
        qt = False
    hide_splash_if_necessary()

    if qt:
        cmd = shell_escape(vistrails_root_directory() +
                           '/gui/bundles/linux_debian_install.py')
    else:
        cmd = '%s install -y' % ('aptitude'
                                 if executable_is_in_path('aptitude')
                                 else 'apt-get')

    return run_install_command(qt, cmd, package_name)
Ejemplo n.º 4
0
def pip_install(package_name):
    hide_splash_if_necessary()

    if executable_is_in_path('pip'):
        cmd = '%s install' % shell_escape(get_executable_path('pip'))
    else:
        cmd = shell_escape(sys.executable) + ' -m pip install'

    if systemType != 'Windows':
        use_root = True
        try:
            from distutils.sysconfig import get_python_lib
            f = get_python_lib()
        except Exception:
            f = sys.executable
        use_root = os.stat(f).st_uid == 0
    else:
        use_root = False

    return run_install_command(qt_available(), cmd, package_name, use_root)