# Hanging downloads from neuropixel

**URL:** <https://community.brain-map.org/t/hanging-downloads-from-neuropixel/351>\
**Category:** Technical\
**Tags:** brain-observatory-visual-coding, how-to, allensdk\
**Created:** [November 14, 2019, 10:22pm UTC](https://community.brain-map.org/t/hanging-downloads-from-neuropixel/351 "2019-11-14T22:22:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![deanp3](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@deanp3](https://community.brain-map.org/u/deanp3)\
**Post date:** [November 14, 2019, 10:22pm UTC](https://community.brain-map.org/t/hanging-downloads-from-neuropixel/351/1 "2019-11-14T22:22:31Z")

</div>

I am trying to download all spike data from the neuropixel data set. I used the ‘Accessing Neuropixels Visual Coding Data’ tutorials code on doing this from the section: Downloading the complete dataset. Three times now it has begun on a file but hung indefinitely (nwb files byte count unchanging over minutes after downloading over a gigabyte). Do you have advice/time out code snippets to address this problem? The code I use is below:

```
import os
import shutil

import numpy as np
import pandas as pd

from allensdk.brain_observatory.ecephys.ecephys_project_cache import EcephysProjectCache

data_directory = '/loc6tb/data/responses/np_allen/' # must be updated to a valid directory in your filesystem

manifest_path = os.path.join(data_directory, "manifest.json")

cache = EcephysProjectCache.from_warehouse(manifest=manifest_path)

sessions = cache.get_session_table()

for session_id, row in sessions.iterrows():
    
    truncated_file = True
    directory = os.path.join(data_directory + '/session_' + str(session_id))
    
    while truncated_file:
        session = cache.get_session_data(session_id)
        try:
            print(session.specimen_name)
            truncated_file = False
        except OSError:
            shutil.rmtree(directory)
            print(" Truncated spikes file, re-downloading")
```

---

<div class="post-metadata">

**Author:** ![joshs](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/joshs/32/8_2.png) [@joshs](https://community.brain-map.org/u/joshs)\
**Post date:** [November 15, 2019, 9:52pm UTC](https://community.brain-map.org/t/hanging-downloads-from-neuropixel/351/2 "2019-11-15T21:52:18Z")

</div>

Hanging downloads is an issue we’re aware of, and we’re working on a fix. In the meantime, can you try scrolling to the end of that notebook and using the [api.brain-map.org](http://api.brain-map.org) links to download the NWB files through your browser? That seems to work more reliably than requesting them through the SDK (at least for now).

---

<div class="post-metadata">

**Author:** ![nileg](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/nileg/32/39_2.png) [@nileg](https://community.brain-map.org/u/nileg)\
**Post date:** [November 18, 2019, 8:50pm UTC](https://community.brain-map.org/t/hanging-downloads-from-neuropixel/351/3 "2019-11-18T20:50:30Z")

</div>

Hi deanp3,

Welcome to the forum!

We’re tracking this issue here: [https://github.com/AllenInstitute/AllenSDK/issues/1214](https://github.com/AllenInstitute/AllenSDK/issues/1214) and hope to have it resolved soon.

---

<div class="post-metadata">

**Author:** ![joshs](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/joshs/32/8_2.png) [@joshs](https://community.brain-map.org/u/joshs)\
**Post date:** [December 13, 2019, 7:55pm UTC](https://community.brain-map.org/t/hanging-downloads-from-neuropixel/351/4 "2019-12-13T19:55:04Z")

</div>

Hi there! We just implemented some changes to the AllenSDK (v1.3.0) that reduce download times and will return an error if the download can’t be completed (instead of hanging forever).

Can you try running `pip install allensdk --upgrade` and see if this fixes the problem for you?
