# SampleData download is failing on MacOS preview

**URL:** <https://discourse.slicer.org/t/sampledata-download-is-failing-on-macos-preview/44123>\
**Category:** Support\
**Created:** [August 18, 2025, 5:09pm UTC](https://discourse.slicer.org/t/sampledata-download-is-failing-on-macos-preview/44123 "2025-08-18T17:09:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 18, 2025, 5:09pm UTC](https://discourse.slicer.org/t/sampledata-download-is-failing-on-macos-preview/44123/1 "2025-08-18T17:09:36Z")

</div>

This has been going on for a while. I am posting here to increase its visibility:

> <https://github.com/Slicer/Slicer/issues/8541>
>
> \## Summary
> 
> In 5.8.1 using the \`downloadFile\` method from \`SampleData\` or \`slice…r.util\` works on Mac, but on 5.9 as of the past few days it has stopped working for https endpoints.
> 
> Importantly, it works when running \`PythonSlicer\` but not in Slicer's python console or in scripted modules.
> 
> Seems to work fine on other platforms too.
> 
> Note that using the SampleData module to test can be misleading since many developers already have most of the datasets in their caches. Be sure to delete the files if using SampleData to test. (e.g. \`rm /Users/pieper/Library/Caches/slicer.org/Slicer/SlicerIO/MR-head.nrrd\`)
> 
> 
> \## Steps to reproduce
> 
> Run these commands:
> \`\`\`
> \>\>\> import urllib.request
> \>\>\> urllib.request.urlretrieve("https://github.com/muratmaga/E15-Atlas/releases/download/v1/antspy-template.nrrd", "/tmp/a.nrrd")
> Traceback (most recent call last):
> File "\<console\>", line 1, in \<module\>
> File "/private/tmp/Slicer.app/Contents/lib/Python/lib/python3.12/urllib/request.py", line 240, in urlretrieve
> with contextlib.closing(urlopen(url, data)) as fp:
> ^^^^^^^^^^^^^^^^^^
> File "/private/tmp/Slicer.app/Contents/lib/Python/lib/python3.12/urllib/request.py", line 215, in urlopen
> return opener.open(url, data, timeout)
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/private/tmp/Slicer.app/Contents/lib/Python/lib/python3.12/urllib/request.py", line 515, in open
> response = self.\_open(req, data)
> ^^^^^^^^^^^^^^^^^^^^^
> File "/private/tmp/Slicer.app/Contents/lib/Python/lib/python3.12/urllib/request.py", line 537, in \_open
> return self.\_call\_chain(self.handle\_open, 'unknown',
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/private/tmp/Slicer.app/Contents/lib/Python/lib/python3.12/urllib/request.py", line 492, in \_call\_chain
> result = func(\*args)
> ^^^^^^^^^^^
> File "/private/tmp/Slicer.app/Contents/lib/Python/lib/python3.12/urllib/request.py", line 1420, in unknown\_open
> raise URLError('unknown url type: %s' % type)
> urllib.error.URLError: \<urlopen error unknown url type: https\>
> \>\>\> 
> \`\`\`
> 
> 
> \## Environment
> \- Slicer version: Slicer-5.9-2025--07-07
> \- Operating system: Mac + tested on both amd64 and arm64

```auto
Requesting download CTP-cardio.seq.nrrd from https://github.com/Slicer/SlicerDataStore/releases/download/SHA256/7fbb6ad0aed9c00820d66e143c2f037568025ed63db0a8db05ae7f26affeb1c2 ...
Download failed: 
Download failed (attempt 1 of 3)...
Requesting download CTP-cardio.seq.nrrd from https://github.com/Slicer/SlicerDataStore/releases/download/SHA256/7fbb6ad0aed9c00820d66e143c2f037568025ed63db0a8db05ae7f26affeb1c2 ...
Download failed: 
Download failed (attempt 2 of 3)...
Requesting download CTP-cardio.seq.nrrd from https://github.com/Slicer/SlicerDataStore/releases/download/SHA256/7fbb6ad0aed9c00820d66e143c2f037568025ed63db0a8db05ae7f26affeb1c2 ...
Download failed: 
Download failed (attempt 3 of 3)...

```
