update setup for unknown packages

This commit is contained in:
Vladimir Mandic
2023-04-20 17:05:45 -04:00
parent 0282832f12
commit 6556ab66c5
3 changed files with 7 additions and 4 deletions
+2
View File
@@ -74,6 +74,8 @@ def run_python(code, desc=None, errdesc=None):
def run_pip(pkg, desc=None):
if desc is None:
desc = pkg
index_url_line = f' --index-url {index_url}' if index_url != '' else ''
return run(f'"{sys.executable}" -m pip {pkg} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}")
+2 -2
View File
@@ -38,7 +38,6 @@ requests
resize-right
rich
safetensors
scikit-image
scipy
tb_nightly
toml
@@ -50,9 +49,9 @@ tqdm
voluptuous
yapf
scikit-image==0.19.3
accelerate==0.18.0
opencv-python==4.7.0.72
timm==0.6.13
diffusers==0.15.0
einops==0.4.1
gradio==3.23.0
@@ -62,3 +61,4 @@ protobuf==3.20.3
pytorch_lightning==1.9.4
tensorflow==2.12.0
transformers==4.26.1
timm==0.6.13
+3 -2
View File
@@ -64,7 +64,8 @@ def installed(package, friendly: str = None):
if friendly:
pkgs = [friendly]
else:
pkgs = [p for p in package.split() if not p.startswith('-') and not p.startswith('git+') and not p.startswith('http') and not p.startswith('=')]
pkgs = [p for p in package.split() if not p.startswith('-') and not p.startswith('=')]
pkgs = [p.split('/')[-1] for p in pkgs] # get only package name if installing from url
for pkg in pkgs:
p = pkg.split('==')
spec = pkg_resources.working_set.by_key.get(p[0], None) # more reliable than importlib
@@ -243,7 +244,7 @@ def run_extension_installer(folder):
log.debug(f"Running extension installer: {path_installer}")
env = os.environ.copy()
env['PYTHONPATH'] = os.path.abspath(".")
result = subprocess.run(f'"{sys.executable}" "{path_installer}"', shell=True, env=env, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = subprocess.run(f'"{sys.executable}" "{path_installer}"', shell=True, env=env, check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=folder)
if result.returncode != 0:
global errors # pylint: disable=global-statement
errors += 1