question

corysimpson-5841 avatar image
0 Votes"
corysimpson-5841 asked ·

python dependencies in batch api

Hello,

I am trying to run a python script that has some package dependencies beyond that of the standard libraries. Specifically, I need pandas and numpy. Im in a windows environment. Ive been hunting for hours and cant quite find it. Here is my pool creation for now, and it doesnt work. Am I just not going about it the right way? Do I need make an "application package" or something? That seems overkill if Im able to call the command line directly.

    task_commands = ["curl -fSsL https://bootstrap.pypa.io/get-pip.py | python", "pip install numpy", "pip install 
         pandas", "python myScript.py 1 3"]
    
     pool = batchmodels.PoolAddParameter(
         id=pool_id,
         virtual_machine_configuration=batchmodels.VirtualMachineConfiguration(
             image_reference=image_ref_to_use,
             node_agent_sku_id=sku_to_use),
         vm_size=vm_size,
         target_dedicated_nodes=vm_count,
         start_task=batchmodels.StartTask(
             command_line=common.helpers.wrap_commands_in_shell(windows,task_commands),
             resource_files=[batchmodels.ResourceFile(
                             file_path=task_name,
                             http_url=sas_url)]))


azure-virtual-machinesazure-batch
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@corysimpson-5841 Did that help answer your question? Please 'Accept as answer' if it did, so that it can help others in the community.

0 Votes 0 ·

1 Answer

XingWu-2910 avatar image
1 Vote"
XingWu-2910 answered ·

Hi,

I assume you try to run this start task command in standard windows image. However, the standard windows doesn't have python pre-installed. You have to install the python first. Also "curl" is not a standard windows command.

Thanks

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.