lsun
lsun copied to clipboard
Getting 'curl' is not recognized on windows machine (download.py)
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.
Sorry Windows is not supported. You can probably try the linux subsystem on windows.
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"