Debug | ‘wget‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。

报错信息
'wget' 不是内部或外部命令,也不是可运行的程序或批处理文件。

分析
在jupyter notebook使用!wget遇到了这个问题,查到发现wget是linux系统下,windows不自带。

解决方法
wget官网下载,选择32位/64位,下载ZIP/EXE,将下载下来的EXE文件放到C:\Windows\System32即可。

叨下后续:
由于我用的是jupyter notebook。虽然windows的cmd可以用了,但是不能直接在jupyter cell里面使用!wget
首先要说的是cmd运行wget,下载的文件就在你运行的文件夹,比如我在用户文件下运行的就在用户文件夹去找。
在这里插入图片描述
jupyter的terminal下可以运行wget。同理,当我没指定文件夹,直接运行wget下载的文件也在用户文件夹下,即C:\Users\***

但是,当我想在jupyter cell!wget的时候,就问题还在,迷惑.jpg。网上看的这个解决方案,貌似是针对本来是linux系统的,但是jupyter环境缺少了wget的问题。如果运行会发现套娃bug,比如apt-get 不是内部或外部命令...

由于本人用的是windows系统,个人找的解决方案是将我们之前下载的wget.exe放到要运行的文件夹下,再运行!wget就行了。

然后这篇博客提供了将下载文件保存到指定目录的方法。
比如将网址的文件保存到目录下,使用wget -P 目录 网址指令即可。

这样的话,很多类似问题都可以类推啦。

没找到一劳永逸的方法,尝试了一些,包括添加到系统环境变量,也没成功,如果大家知道,欢迎提建议~

  • 65
    点赞
  • 87
    收藏
    觉得还不错? 一键收藏
  • 10
    评论
windowswget命令 使用帮助wget --help Startup: -V, --version display the version of Wget and exit. -b, --background go to background after startup. -e, --execute=COMMAND execute a `.wgetrc' command. Logging and input file: -o, --output-file=FILE log messages to FILE. -a, --append-output=FILE append messages to FILE. -d, --debug print debug output. -q, --quiet quiet (no output). -v, --verbose be verbose (this is the default). -nv, --non-verbose turn off verboseness, without being quiet. -i, --input-file=FILE read URL-s from file. -F, --force-html treat input file as HTML. Download: -t, --tries=NUMBER set number of retries to NUMBER (0 unlimits). -O --output-document=FILE write documents to FILE. -nc, --no-clobber don't clobber existing files. -c, --continue restart getting an existing file. --dot-style=STYLE set retrieval display style. -N, --timestamping don't retrieve files if older than local. -S, --server-response print server response. --spider don't download anything. -T, --timeout=SECONDS set the read timeout to SECONDS. -w, --wait=SECONDS wait SECONDS between retrievals. -Y, --proxy=on/off turn proxy on or off. -Q, --quota=NUMBER set retrieval quota to NUMBER. Directories: -nd --no-directories don't create directories. -x, --force-directories force creation of directories. -nH, --no-host-directories don't create host directories. -P, --directory-prefix=PREFIX save files to PREFIX/... --cut-dirs=NUMBER ignore NUMBER remote directory components. HTTP options: --http-user=USER set http user to USER. --http-passwd=PASS set http password to PASS. -C, --cache=on/off (dis)allow server-cached data (normally allowed). --ignore-length ignore `Content-Length' header field. --header=STRING insert STRING among the headers. --proxy-user=USER set USER as proxy username. --proxy-passwd=PASS set PASS as proxy password. -s, --save-headers save the HTTP headers to file. -U, --user-agent=AGENT identify as AGENT instead of Wget/VERSION. FTP options: --retr-symlinks retrieve FTP symbolic links. -g, --glob=on/off turn file name globbing on or off. --passive-ftp use the "passive" transfer mode. Recursive retrieval: -r, --recursive recursive web-suck -- use with care!. -l, --level=NUMBER maximum recursion depth (0 to unlimit). --delete-after delete downloaded files. -k, --convert-links convert non-relative links to relative. -m, --mirror turn on options suitable for mirroring. -nr, --dont-remove-listing don't remove `.listing' files. Recursive accept/reject: -A, --accept=LIST list of accepted extensions. -R, --reject=LIST list of rejected extensions. -D, --domains=LIST list of accepted domains. --exclude-domains=LIST comma-separated list of rejected domains. -L, --relative follow relative links only. --follow-ftp follow FTP links from HTML documents. -H, --span-hosts go to foreign hosts when recursive. -I, --include-directories=LIST list of allowed directories. -X, --exclude-directories=LIST list of excluded directories. -nh, --no-host-lookup don't DNS-lookup hosts. -np, --no-parent don't ascend to the parent directory.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值