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

Viewed 8975

I'm running Jupyter Notebook 6.0.1 via Anaconda Navigator, and was working on a Jupyter Notebook using Python 3. Need help to download data using wget. Appreciate a step-by-step solution as I'm new to coding. Thanks.

The code I typed to install wget:

!pip install wget

It returns: Requirement already satisfied: wget in c:\users\louie\anaconda3\lib\site-packages (3.2)

The code to download data:

import wget
!wget -q -O 'newyork_data.json' https://cocl.us/new_york_dataset
print('Data downloaded!')

I get this error message:

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

snapshot of code

2 Answers
!pip install wget

!python -m wget -o 'newyork_data.json' https://cocl.us/new_york_dataset

or:

!pip install wget
import wget
url = 'https://cocl.us/new_york_dataset'
filename = wget.download(url)
print(filename)
Related