0

I'm using a Jupyter notebook through Anaconda.

I have a command: ! wget https://url

I get the error:

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

I already tried installing wget on my local Anaconda (as I expected, it doesn't work)

Thanks

user3329732
  • 346
  • 2
  • 15

1 Answers1

1

wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used internet protocols. To install wget in Anaconda run:

conda install -c anaconda wget 

If that doesn't work try:

conda install -c menpo wget 

Anaconda should have added jupyter to your PATH automatically during the installation if you selected that option. If you did not select it, you need to do this manually by following the steps in answers to Anaconda Packages.

karel
  • 5,489
  • 46
  • 45
  • 50
  • the second option worked locally. But I still get the same error in Jupyter. When trying "! conda install -c menpo wget" actually in Jupyter nothing happens, not even an error. "! conda install -c anaconda wget" gives me anunavailable error (in Jupyter) – user3329732 Jun 24 '22 at 07:12
  • 1
    Try replacing your exclamation points with the symbol `%`. You'll have a better experience using the modern magics added for `pip` and `conda` use inside a notebook, essentially `%pip` and `%conda` because the magic commands insure it uses the environment backing your notebook. The exclamation point often leads to issues because it doesn't handle that critical task. See [here](https://discourse.jupyter.org/t/why-users-can-install-modules-from-pip-but-not-from-conda/10722/4?u=fomightez) for more information about the modern magic commands for `pip` and `conda` use inside cells in a notebook. – Wayne Jun 24 '22 at 16:01
  • 1
    Also, note that because automagics are generally on by default in modern Jupyter installations, you can leave off a symbol for `pip` or `conda` use in a cell in a notebook now and the modern magic command equivalents, `%pip` or `%conda`, will get used behind the scenes. Most people will tell you though that explicit is always better because you and others looking at your command and seeing `%pip` or `%conda` will more easily determine what is happening. In short, anything suggesting you use an exclamation point with `pip` or `conda` inside Jupyter now is outdated & should be treated as such. – Wayne Jun 24 '22 at 16:06