Wget function is not working

Why won’t the wget function work? I downloaded it. I don’t get why its not working. If I download it, it should work. This is very frustrating.

Hello parso1mr and welcome to the community!

The initial thing that comes to mind is making sure you installed wget in the same environment that you’ve launched Jupyter notebook in.

Beyond that though, a few questions to help us help you out:

  1. How did you launch Jupyter Notebook? Did you install and click the button in Navigator? Did you start it from the command line?
  2. How did you download and install wget?
  3. Are you familiar with conda environments and did you run any of this in a particular environment?

I downloaded them in the anaconda navigator which is where I launched the Jupyter Notebook in. Then I used the !pip install wget function and it says its there.

The issue is that the wget from PyPI (installed with pip) is the wget python library. It allows you to use wget from within python, but not from a shell (using the “!wget url” syntax). That library actually appears to be pretty old and the repository for it doesn’t appear to be up, so I’m not sure how trustworthy it is.

However, to use wget as you’re intending in your notebook, you need to install the command line version of wget. You can do this by uninstalling the PyPI wget (!pip uninstall wget), then install wget with conda. You can either do that from the notebook (!conda install wget) or from Navigator (select “all” in that dropdown at the top, then search for wget and install the one that shows up). You’ll know you’ve got the right thing if the version shows as 1.21.4 in Navigator.

This is a slightly confusing one because the PyPI package and the conda package for wget are two very different things. However, the one you want is the conda package. I hope that helps!

Still doesn’t work. Its not recognizing it and its not in the navigator.

This is the navigator. It only gives me the one option.

I just noticed that it looks like you’re running on Windows. Unfortunately it looks like there’s no Windows build for wget, which is why it’s not showing up for you. I can think of a few options here:

  1. The official GNU page for wget offers some Windows download options in their FAQ
  2. It looks like someone has created a windows build of wget on anaconda.org that has a large number of downloads, so you can try the install command there. Note that some packages on anaconda.org are user uploaded, so we can’t validate the safety of all of them.
  3. You can try something different to perform the download. curl is available on all platforms and curl -O operates similarly to wget. Windows also may have another native command for downloads.
  4. You may want to look into the notebook you’re creating and what you’re going to do with your data files once loaded. Many libraries can load datasets directly from the web by providing the url instead of a filename, instead of having to download first then load for data analysis.

Just a few thoughts. Hopefully there’s some helpful advice in there :slight_smile: