示例#1
0
def install_package(package):
    import pip
    try:
        from pip._internal import main
        main.main(['install', package])
    except AttributeError:
        from pip import __main__
        __main__._main(['install', package])
示例#2
0
文件: cli.py 项目: pawnhearts/pep582
def freeze():
    import pip, os, itertools
    from pip.__main__ import _main
    from pep582.site import pypackages_path
    sys.path = [pypackages_path,
                os.path.dirname(pip.__file__)
                ] + [p for p in sys.path if '-packages' not in p]
    print(sys.path)
    _main()
示例#3
0
import lyrebird
import pip


if __name__ == '__main__':
    version_num = pip.__version__[:pip.__version__.find('.')]
    if int(version_num) >= 10:
        from pip import __main__
        __main__._main(['install', '.',  '--upgrade'])
    else:
        pip.main(['install', '.',  '--upgrade'])
    lyrebird.main()

示例#4
0
# vim /usr/bin/pip
# 替换为
from pip import __main__
if __name__ == '__main__':
    sys.exit(__main__._main())
# 升级pip
# python -m pip install --upgrade pip