snakemake-workflows / dna-seq-gatk-variant-calling

This Snakemake pipeline implements the GATK best-practices workflow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Non-ASCII character in .py, no encoding declared

greenkidneybean opened this issue Β· comments

When running snakemake --use-conda from the project root of the project directory I get the following error (line 43 of attached
snakemake.log):

SyntaxError: Non-ASCII character '\xc3' in file /spin1/users/chambersmj/snakemake_test/.snakemake/scripts/tmpmfjaxtfh.wrapper.py on line 5, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

I thought of adding #coding=utf-8 to the head of .snakemake/scripts/tmpmfjaxtfh.wrapper.py but there are no scripts in the .snakemake/scripts directory.

Any suggestions to resolve the python source file encoding would be greatly appreciated 😊

Note: I've also attached the default config.yaml, the project tree is below, and the data directory was cloned from snakemake-workflows/ngs-test-data.

snakemake_test
β”œβ”€β”€ config.txt
β”œβ”€β”€ config.yaml
β”œβ”€β”€ data
β”œβ”€β”€ envs
β”œβ”€β”€ LICENSE
β”œβ”€β”€ logs
β”œβ”€β”€ mapped
β”œβ”€β”€ README.md
β”œβ”€β”€ report
β”œβ”€β”€ rules
β”œβ”€β”€ samples.tsv
β”œβ”€β”€ schemas
β”œβ”€β”€ scripts
β”œβ”€β”€ Snakefile
β”œβ”€β”€ snakemake.log
β”œβ”€β”€ trimmed
└── units.tsv

This issue has been resolved.

tmux was pointing Python to the system version (2.7) and not my conda environment (3.6). Still not sure why tmux points to a different python version as opposed to when I'm detached from a session. Cheers!

No idea, I use tmux all the time. Maybe an issue with your shell configuration?

Starting a tmux session appended a few directories to my path, which was surpassing the conda path. I added the following line to my .tmux.conf to fix: set -g default-command "${SHELL}"