wget command not found in git bash

Viewed 22502

I've already tried pip install wget in my cmd, which reads

>pip install wget
Requirement already satisfied: wget in c:\users\user\...\python\python38-32\lib\site-packages (3.2)

however when I try the command in git bash, it keeps showing

$ wget
bash: wget: command not found

I've made sure both the python file and the git file are in PATH.

What am I doing wrong here?

3 Answers

If you would like to use curl on Git Bash, here is an example:

$ curl -kLSs https://github.com/opscode/chef-repo/tarball/master -o master.tar.gz
  
$ ls master.tar.gz
master.tar.gz
  • -L follow redirects
  • -o (lower case O) to write output to file instead of stdout.
  • Ss silent mode, but show errors, if any
  • k allows curl to proceed and operate even for server connections otherwise considered insecure.

Reference: curl manpage.

With the command:

pip install wget

you installed this Python library https://pypi.org/project/wget/, so you can use that from inside Python:

import wget

I imagine what you actually want is to be able to use wget from inside Git bash. To do what, install Wget for Windows and add the executable to the path. Or, alternatively, use curl.

Quick and dirty replacement for the single argument, fetch a file usecase:

alias wget='curl -O'

-O, --remote-name Write output to a file named as the remote file

Maybe give the alias a different name so you don't try to use wget flags in curl.

Related