Exemplo n.º 1
0
def pip_exact_search(name):
    old_stdout = sys.stdout
    sys.stdout = mystdout = StringIO()
    callable_pip.main('search', name, '--disable-pip-version-check')
    sys.stdout = old_stdout
    output = mystdout.getvalue().lower().replace('-', '_')
    r = re.compile("^{} .*$".format(name), re.I | re.M).search(output)
    return r is not None
Exemplo n.º 2
0
from callable_pip import main

try:
    from PyQt5.QtCore import *
    from PyQt5.QtWidgets import *
    from PyQt5.QtWebEngineWidgets import *
    from PyQt5.QtGui import *
except ImportError:
    main(['install', 'PyQt5'])
    from PyQt5.QtCore import *
    from PyQt5.QtWidgets import *
    from PyQt5.QtWebEngineWidgets import *
    from PyQt5.QtGui import *

try:
    import sip
except ImportError:
    main(['install', 'SIP'])
    import sip
import sys
import os
from functools import partial
try:
    import easygui as gui
except ImportError:
    main(['install', 'easygui'])
    import easygui as gui
eb = gui.exceptionbox
import _apps
from getpass import getuser
from time import time, sleep
Exemplo n.º 3
0
 def install_python_dependencies(dependencies: List[str]):
     """
     Call pip to install the given python dependencies.
     :param dependencies: List of python modules to install
     """
     callable_pip.main("install", *dependencies)
Exemplo n.º 4
0
def install_package(src, dst):
    cpip.main('install', src, '--force-reinstall', '--no-cache-dir',
              '--upgrade', '--target', dst)
Exemplo n.º 5
0
def download_package(name, paent_dir):
    pip.main('download', '-d', f'{paent_dir}{os.sep}{name}', name)
    return f'{paent_dir}{os.sep}{name}'