I am simply trying to download a file from github, but my wget
command is not being recognized. I am unsure what is going on. I've read that I should use urlopen
instead, but I run into the same error.
Asked
Active
Viewed 6,412 times
-1

Binx
- 382
- 7
- 22
-
2can you try `python -m wget` instead of `wget`? – PApostol Sep 09 '20 at 19:42
-
Thank you. This worked! – Binx Sep 09 '20 at 19:56
-
why do I have to call python is I am already running anaconda? – Binx Sep 09 '20 at 20:00
-
2If you `pip install wget`, it makes `wget` a python module, for which you need `python -m` to run (`m` is for module). – PApostol Sep 09 '20 at 20:20
-
Great Thank you! – Binx Sep 09 '20 at 20:24
2 Answers
1
wget
is usually provided with unix / linux operating system. It seems you are on windows, so you can:
- Download it for windows (http://gnuwin32.sourceforge.net/packages/wget.htm) and put in in your
PATH
environmnent variable - Use cygwin (https://www.cygwin.com) / babun
- Use Docker
Also, wget
only "download" a file. If you need it for only a few files, you can download them manually.

Blusky
- 3,470
- 1
- 19
- 35
1
To install and configure wget for Windows:
- Download wget for Windows (http://gnuwin32.sourceforge.net/packages/wget.htm) and install the package.
- Add the wget bin path to environment variables (optional). Configuring this removes the need for full paths, and makes it a lot easier to run wget from the command prompt:
Open the Start menu and search for “environment.”
Select > Edit the system environment variables.
Select the Advanced tab and click the Environment Variables button.
Select the Path variable under System Variables.
Click Edit.
In the Variable value field add the path to the wget bin directory preceded by a semicolon (;). If installed in the default path, add C:\Program Files (x86)\GnuWin32\bin. - Open the command prompt (cmd.exe) and start running wget commands.

idar
- 614
- 6
- 13