diff --git a/.github/workflows/pythonapp-gpu.yml b/.github/workflows/pythonapp-gpu.yml index 848eaedcd6..7825c03ae1 100644 --- a/.github/workflows/pythonapp-gpu.yml +++ b/.github/workflows/pythonapp-gpu.yml @@ -101,7 +101,7 @@ jobs: - name: Install dependencies run: | which python - python -m pip install --upgrade pip wheel + python -m pip install --upgrade pip==21.3.1 wheel # workaround monai##3752 # fixes preinstalled ruamel_yaml error from the docker image rm -rf $(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/ruamel* python -m pip install ${{ matrix.pytorch }} diff --git a/monai/apps/utils.py b/monai/apps/utils.py index 9db62f336d..209dc796cf 100644 --- a/monai/apps/utils.py +++ b/monai/apps/utils.py @@ -183,24 +183,26 @@ def download_url( ) logger.info(f"File exists: {filepath}, skipped downloading.") return - - with tempfile.TemporaryDirectory() as tmp_dir: - tmp_name = Path(tmp_dir, _basename(filepath)) - if urlparse(url).netloc == "drive.google.com": - if not has_gdown: - raise RuntimeError("To download files from Google Drive, please install the gdown dependency.") - gdown.download(url, f"{tmp_name}", quiet=not progress) - else: - _download_with_progress(url, tmp_name, progress=progress) - if not tmp_name.exists(): - raise RuntimeError( - f"Download of file from {url} to {filepath} failed due to network issue or denied permission." - ) - file_dir = filepath.parent - if file_dir: - os.makedirs(file_dir, exist_ok=True) - shutil.move(f"{tmp_name}", f"{filepath}") # copy the downloaded to a user-specified cache. - logger.info(f"Downloaded: {filepath}") + try: + with tempfile.TemporaryDirectory() as tmp_dir: + tmp_name = Path(tmp_dir, _basename(filepath)) + if urlparse(url).netloc == "drive.google.com": + if not has_gdown: + raise RuntimeError("To download files from Google Drive, please install the gdown dependency.") + gdown.download(url, f"{tmp_name}", quiet=not progress) + else: + _download_with_progress(url, tmp_name, progress=progress) + if not tmp_name.exists(): + raise RuntimeError( + f"Download of file from {url} to {filepath} failed due to network issue or denied permission." + ) + file_dir = filepath.parent + if file_dir: + os.makedirs(file_dir, exist_ok=True) + shutil.move(f"{tmp_name}", f"{filepath}") # copy the downloaded to a user-specified cache. + except (PermissionError, NotADirectoryError): # project-monai/monai issue #3613 #3757 for windows + pass + logger.info(f"Downloaded: {filepath}") if not check_hash(filepath, hash_val, hash_type): raise RuntimeError( f"{hash_type} check of downloaded file failed: URL={url}, " diff --git a/requirements-min.txt b/requirements-min.txt index 195f6f49f4..63906b4a94 100644 --- a/requirements-min.txt +++ b/requirements-min.txt @@ -1,5 +1,5 @@ # Requirements for minimal tests -r requirements.txt -setuptools>=50.3.0,!=60.0.0 +setuptools>=50.3.0,!=60.0.0,!=60.6.0 coverage>=5.5 parameterized