lsun icon indicating copy to clipboard operation
lsun copied to clipboard

Getting 'curl' is not recognized on windows machine (download.py)

Open vasanthhr opened this issue 6 years ago • 2 comments

Can you please guide me the way that I need to send data to subprocess.call on windows machine I suspect that the args/parmater curl should be different format, looks like below format is not accepting and getting below mentioned errors

my machine : OS Name Microsoft Windows Server 2016 Datacenter

Tried in both Python3 and Python2, but getting the same error.

Please help me on the same.

def download(out_dir, category, set_name, tag): url = 'http://lsun.cs.princeton.edu/htbin/download.cgi?tag={tag}'
'&category={category}&set={set_name}'.format(**locals()) if set_name == 'test': out_name = 'test_lmdb.zip' else: out_name = '{category}_{set_name}_lmdb.zip'.format(**locals()) out_path = join(out_dir, out_name) cmd = ['curl', url, '-o', out_path] print('Downloading', category, set_name, 'set') subprocess.call(cmd, shell=True)

But getting below error

'curl' is not recognized as an internal or external command, operable program or batch file. 'category' is not recognized as an internal or external command, operable program or batch file. The syntax of the command is incorrect. Downloading bridge val set 'curl' is not recognized as an internal or external command, operable program or batch file. 'category' is not recognized as an internal or external command, operable program or batch file. The syntax of the command is incorrect.

vasanthhr avatar Apr 17 '18 03:04 vasanthhr

Sorry Windows is not supported. You can probably try the linux subsystem on windows.

fyu avatar Apr 17 '18 03:04 fyu

With a current version of powershell (entering $psversiontable shows 5.1 on my machine) curl is automatically mapped to Invoke-WebRequest. You can see this by entering "Get-Help curl" from your powershell command prompt.

So the above comment should have just been "Curl is not needed on Windows, just execute your python script from a Powershell prompt"

jefflomax avatar Dec 28 '19 02:12 jefflomax