Update to stop using "import pip" which is an unsupported usage.

pull/56/merge
morpheus65535 6 years ago
parent a6c067e79f
commit 0a6b82eedd

@ -8,7 +8,6 @@ enzyme
gitpython gitpython
langdetect langdetect
Pillow Pillow
pip<=9.0.1
py-pretty py-pretty
pycountry pycountry
pytz pytz

@ -1,21 +1,28 @@
import pip import subprocess
from subprocess import check_output
import logging
import os
import sys
try: try:
pip.main(['install', '--user', 'gitpython']) logging.info('Installing Python modules required for Bazarr...')
except SystemExit as e:
pass
try: command = sys.executable + ' -m pip --disable-pip-version-check -q -q install -r ' + os.path.join(os.path.dirname(__file__), 'requirements.txt')
pip.main(['install', '--user', 'langdetect'])
except SystemExit as e:
pass
try: if os.name == 'nt':
pip.main(['install', '--user', 'apprise']) codepage = check_output("chcp", shell=True, stderr=subprocess.STDOUT)
except SystemExit as e: encoding = codepage.split(':')[-1].strip()
pass
try: process = check_output(command, shell=True, stderr=subprocess.STDOUT)
pip.main(['install', '--user', 'tzlocal'])
except SystemExit as e: if os.name == 'nt':
pass process = process.decode(encoding)
except:
logging.error('Unable to install requirements using command line PIP. Is PIP installed and included in system path?')
pass
else:
if process == "":
logging.info('Required Python modules installed if missing.')
else:
for line in process.splitlines():
logging.error(line)
Loading…
Cancel
Save