Skip to content

Snakemake version 8+ doesn't handle local imports appropriately #767

Description

@apigott

Version Checks (indicate both or one)

The Issue

Snakemake v8+ changes the way the directory is cached. This causes error messages related to any local imports of the PyPSA-USA scripts directory. This can be fixed 2 ways:

  1. Temp fix: import the directory path to the system $PYTHONPATH in the terminal: export PYTHONPATH="/scratch/htc/oet/044_kinetics/pypsa-usa/workflow/scripts:$PYTHONPATH"

  2. Permanent fix: add the directory path during script execution sys.path.insert(0, os.path.dirname(__file__)) in each affected file

Steps To Reproduce

No response

Error Message

Anything else?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions