wget is not recognized as a command even though it is installed
Asked Answered
N

4

6

I know I am doing something really stupid here but I have tried the things I can think of.

Here is the relevant portion of my session:

$ wget http://pjmedia.com/instapundit/
-bash: wget: command not found
$ cd ..
$ pip install wget
Requirement already satisfied (use --upgrade to upgrade): wget in
    ./anaconda/lib/python2.7/site-packages
$ 

I have restarted my computer and that does not help. I am using Mac OX X with the El Capitan system installed. Does this have something to do with the PATH variable? I found something on the internet that seemed similar to my problem with another program on the Windows system, but I have found nothing for the Mac OS. I tried installing it from my root directory but the system won't let pip install it because it is already installed. Can anyone point me in the right direction?

EDIT: I would like to thank Max, Bill and kenorb. I have learned more here for free in 10 minutes than I have in a week at some commercial sites. Is there some way to mark my question as answered so that people don't have to keep wasting their time reading my question?

Nodular answered 11/10, 2015 at 19:16 Comment(3)
Alternatively, use curl -O which is installed by default. thegeekstuff.com/2012/07/wget-curlGesticulate
This is not a programming question, so in future ask similar questions at: superuser.comBurnt
That worked perfectly. Thanks!Nodular
Q
11

Use some OS X package manager like Homebrew (brew) or MacPorts, as pip is used for python modules:

brew install wget
Quimper answered 11/10, 2015 at 19:26 Comment(1)
Welcome to SO. If one of the answers fixes your issue, you should accept it (click the check mark next to the appropriate answer). That does two things. It lets everyone know your issue has been resolved, and it gives the person that helps you credit for the assist. See here for a full explanation.Quimper
D
3

Wget the shell command is probably easiest to get on OSX by using Homebrew, and then running brew install wget.

What you've got there is the python module wget, which follows the same name. It can be used by running python -m wget [options] <URL>, where your options are to supply an output file name with -o. You could always alias this to wget in your .bashrc!

Deceive answered 11/10, 2015 at 19:27 Comment(1)
Thank you very much. The tip about how to use the python module is also very useful.Nodular
C
1

pip installs Python modules. In some cases that includes installing a command-line utility as well, but as far as I can tell, with this module that is not the case. So unless you are going to write a Python script that uses the wget module and fetches the file, this won't do what you want.

The easiest way to install wget is with homebrew, but that does require a small bit of setup. The setup is very worth it, as you can install nearly any "unix" utility from brew, including servers such as nginx or postgresql.

Once homebrew is set up, simply brew install wget and you should be set.

Caskey answered 11/10, 2015 at 19:26 Comment(0)
S
1

make sure that wget is downloaded in your windows, you can download it as exe file then copy and paste it to your system32 path as follows:

https://eternallybored.org/misc/wget/ c/windows/system32/wget

Stcyr answered 11/8, 2022 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.