diff --git a/cortex/utils.py b/cortex/utils.py index 87c6a242..9e8931f1 100644 --- a/cortex/utils.py +++ b/cortex/utils.py @@ -13,7 +13,7 @@ import h5py import numpy as np -import wget +import urllib.request from . import formats from .database import db @@ -1095,10 +1095,13 @@ def download_subject(subject_id='fsaverage', url=None, pycortex_store=None, print("Downloading from: {}".format(url)) with tempfile.TemporaryDirectory() as tmp_dir: print('Downloading subject {} to {}'.format(subject_id, tmp_dir)) - wget.download(url, tmp_dir) - print('Done downloading') + fnout, _ = urllib.request.urlretrieve( + url, + os.path.join(tmp_dir, f"{subject_id}.tar.gz") + ) + print(f'Done downloading to {fnout}') # Un-tar to pycortex store - with tarfile.open(os.path.join(tmp_dir, subject_id + '.tar.gz'), "r:gz") as tar: + with tarfile.open(fnout, "r:gz") as tar: print("Extracting subject {} to {}".format(subject_id, pycortex_store)) tar.extractall(path=pycortex_store) diff --git a/requirements.txt b/requirements.txt index acfa10d6..b30db96c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,3 @@ pillow nibabel>=2.1 networkx>=2.1 imageio -wget