简体   繁体   中英

How to access snakemake.input[0]?

This should be a simple problem, but for the life of me I cannot figure it out. I have a very, very simple Snakefile (shown below):

rule test:
    input:
        "/home/username/input_data"
    script:
        "scripts/test.py"

And in my test.py file, I am doing the following:

import snakemake
print(snakemake.input[0])

But I cannot access snakemake.input[0] . The docs have an example as simple as mine, but I can't get it to work. Additionally, in a Python interactive shell I am able to import snakemake , but I get an error:

ImportError: No module named snakemake

when importing it from my test.py script.

I am calling snakemake test from the command line in the same folder as the Snakefile to run this.

I appreciate any help on this.

I was able to fix my problem by removing a snakemake installation at /usr/bin/snakemake , then reinstalling by following the installation guide here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM