CWL: Problems with path to my python script.
1
0
Entering edit mode
6.9 years ago

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 • 3.0k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
2
Entering edit mode
6.9 years ago

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1439 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6