PayneLab/cptac

NoInternetError: Insufficient internet. Check your internet connection.

Closed this issue · 3 comments

when downloading dataset "endometrial", I am getting the following error:

NoInternetError                           Traceback (most recent call last)
<ipython-input-6-91e437813d7b> in <module>
      1 import cptac
----> 2 cptac.download(dataset="endometrial", version="latest")
      3 en = cptac.Endometrial()

/seq_dir/software/conda/miniconda3/envs/sc-tutorial/lib/python3.8/site-packages/cptac/file_download.py in download(dataset, version, redownload)
     33 
     34     # Update the index
---> 35     update_index(dataset)
     36 
     37     # Load the index

/seq_dir/software/conda/miniconda3/envs/sc-tutorial/lib/python3.8/site-packages/cptac/file_download.py in update_index(dataset)
    125     print(checking_msg, end='\r')
    126     try:
--> 127         server_index_hash = download_text(index_hash_url)
    128     finally:
    129         print(" " * len(checking_msg), end='\r') # Erase the checking message, even if there was an internet error

/seq_dir/software/conda/miniconda3/envs/sc-tutorial/lib/python3.8/site-packages/cptac/file_download.py in download_text(url)
    159         response.raise_for_status() # Raises a requests HTTPError if the response code was unsuccessful
    160     except requests.RequestException: # Parent class for all exceptions in the requests module
--> 161         raise NoInternetError("Insufficient internet. Check your internet connection.") from None
    162 
    163     text = response.text.strip()

NoInternetError: Insufficient internet. Check your internet connection.

It seems that i can not reach the index_hash file (https://byu.box.com/shared/static/ahwu7p01mjotudtaop1wtkiq5kek8tj3.txt). I try to download this file with chrome but failed.
Could you provide a publily available urls for files in datasets? Byu.box.com seems to only provide service accounts to BYU students, faculty and staff.

Thank you for bringing this up! All the download URLs actually are publicly accessible. We are in correspondence with several people who aren't connected with BYU at all, and they're able to download all files without any problems, so that verifies that the files are publicly accessible.

I think the problem may be due to an inconsistent internet connection on your computer. It appears that you were able to successfully execute the "import cptac" command, and executing that command actually downloads a version file to check that your local copy of the package is up-to-date. So, we know that you had a good enough connection to successfully download that file. But for one reason or another, when you tried to download the index file, the connection was no longer sufficient.

I've run into this problem before when I'm using a spotty WiFi network on a train. I also had this issue when I was using the package in a script on a distributed computing network. For whatever reason, the distributed computing network's internet connection was having issues. But when I went back and ran the script on a computer with a good internet connection, there were no problems. Perhaps your problem is similar?

If you have any questions feel free to add another comment.

Meet the same problem. Is there anyway to fix it?

@appleTree2017 does it only happen sometimes, or does it happen all the time? What is the specific code you're running that's causing the error?