Search code examples
pythonwindowsjupyter-notebookanacondawget

wget not working in annaconda jupyter notebook - Windows. Alternative?


I am trying to download github dataset from here:

https://raw.githubusercontent.com/heyunh2015/PARADE_dataset/main/PARADE_test.txt

using a windows machine, and the anaconda host to play jupyter notebook, I am trying to directly download it in the machine using the following command:

 !wget https://raw.githubusercontent.com/heyunh2015/PARADE_dataset/main/PARADE_test.txt

However, it is giving me the following error:

'wget' is not recognized as an internal or external command, operable program or batch file.

Then I tried again after the following command:

!pip install wget

still the same error.

Next, I tried curl, and the error went away, but I am unable to access my downloaded file either through code (the file doesn't exist) or using GUI (doesn't show up in the current working directory).

What to do?


Solution

  • I got my answer.

    import wget
    
    url = "<source>"
    wget.download(url, '<destination>')