Importing python modules from other packages with snakemake

16 Views Asked by At

I have a folder structure of

  • src
    • Snakefile
    • scripts
      • scripts_A
        • A.py
        • A2.py
      • scripts_B
        • B.py

In A.py I have the import statements

import A2 from src.scripts.scripts_B.B import B

This works when I run A as a script normally. However when I try a snakefile with rule

rule stuff: input: a_in output: b_out script: scripts/scripts_A/A.py

it fails with ModuleNotFoundError: No module named 'src'

I've tried changing location of Snakefile to be above and below src

0

There are 0 best solutions below