Question: CWL: Problems with path to my python script.
0
gravatar for sibyllewohlgemuth
2.7 years ago by
sibyllewohlgemuth20 wrote:

Hi! I have python script and a cwl wrapper for the script in the same directory. When I try to run the cwl I get an error because the python script can´t be found. It only works when I specifiy the absolut path to the script in baseCommand. Maybe anyone can give me a hint what I have to add, so the script is found by the cwl-runner? Thanks a lot!

cwl • 1.4k views
ADD COMMENTlink modified 2.7 years ago by Michael R. Crusoe1.8k • written 2.7 years ago by sibyllewohlgemuth20

Have you tried just using the relative path (i.e., ./something.py)?

ADD REPLYlink written 2.7 years ago by Devon Ryan94k

Yes exactly, that is what I tried and what didn´t work. The file is only found when I used the absolute path.

ADD REPLYlink written 2.7 years ago by sibyllewohlgemuth20

Not being a CWL person, I assume the working directory is specified somewhere

ADD REPLYlink written 2.7 years ago by Devon Ryan94k
2
gravatar for Michael R. Crusoe
2.7 years ago by
Common Workflow Language project
Michael R. Crusoe1.8k wrote:

Hello sibyllewohlgemuth, thank you for your question.

If your tool isn't wrapped in a container, and it isn't installed on a standard system path, they you'll need to inform your CWL executor where to find it.

Don't forget to chmod a+x my_script.py and ensure that it starts with #!/usr/bin/env python or similar :-)

For example, with the reference implementation, set your PATH and pass in --preserve-environment PATH to cwltool:

PATH=$PATH:/absolute/path/to/the/directory/of/my/script cwltool --preserve-environment PATH my-tool.cwl my-inputs.yaml

If you are using a Docker container with your tool, then this is easy: configure the container to install your script to a standard path like /usr/bin

I hope this was helpful. Cheers,

ADD COMMENTlink written 2.7 years ago by Michael R. Crusoe1.8k

Hi Michael, Thanks a lot for your help! I was missing that I have to set the path and pass it to cwltool! Best, Sibylle

ADD REPLYlink written 2.7 years ago by sibyllewohlgemuth20

If this answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Upvote|Bookmark|Accept

ADD REPLYlink written 2.7 years ago by WouterDeCoster43k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1635 users visited in the last hour