fix: install python
parent
fdca139c4c
commit
f39fc23d3d
15
install.py
15
install.py
|
|
@ -25,6 +25,7 @@ pycocotools = {
|
|||
(3, 11): "https://github.com/Bing-su/dddetailer/releases/download/pycocotools/pycocotools-2.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
|
||||
},
|
||||
}
|
||||
python = sys.executable
|
||||
|
||||
|
||||
def check_mmcv() -> bool:
|
||||
|
|
@ -63,19 +64,19 @@ def install_pycocotools():
|
|||
|
||||
if system not in ["Windows", "Linux"] or machine not in ["AMD64", "x86_64"]:
|
||||
print("Installing pycocotools from pypi...")
|
||||
run("pip install pycocotools", live=True)
|
||||
run(f'"{python}" -m pip install pycocotools', live=True)
|
||||
return
|
||||
|
||||
links = pycocotools[system]
|
||||
version = sys.version_info[:2]
|
||||
if version not in links:
|
||||
print("Installing pycocotools from pypi...")
|
||||
run("pip install pycocotools", live=True)
|
||||
run(f'"{python}" -m pip install pycocotools', live=True)
|
||||
return
|
||||
|
||||
url = links[version]
|
||||
print("Installing pycocotools...")
|
||||
run(f"pip install {url}", live=True)
|
||||
run(f'"{python}" -m pip install {url}', live=True)
|
||||
|
||||
|
||||
def install():
|
||||
|
|
@ -83,20 +84,20 @@ def install():
|
|||
print("Installing mmcv...")
|
||||
torch_version = torch.__version__
|
||||
if torch_version in mmcv_url:
|
||||
run(f"pip install mmcv -f {mmcv_url[torch_version]}", live=True)
|
||||
run(f'"{python}" -m pip install -U mmcv -f {mmcv_url[torch_version]}', live=True)
|
||||
else:
|
||||
run("pip install mmcv==2.0.0rc4", live=True)
|
||||
run(f'"{python}" -m pip install mmcv==2.0.0rc4', live=True)
|
||||
|
||||
if not is_installed("pycocotools"):
|
||||
install_pycocotools()
|
||||
|
||||
if not check_mmdet():
|
||||
print("Installing mmdet...")
|
||||
run("pip install mmdet==3.0.0rc6", live=True)
|
||||
run(f'"{python}" -m pip install mmdet==3.0.0rc6', live=True)
|
||||
|
||||
if not is_installed("mim"):
|
||||
print("Installing openmim...")
|
||||
run("pip install openmim", live=True)
|
||||
run(f'"{python}" -m pip install openmim', live=True)
|
||||
|
||||
|
||||
install()
|
||||
|
|
|
|||
Loading…
Reference in New Issue