CentOS7下Conda安装Snakemake遇依赖冲突及JSON解析错误求助
Hey there, let's work through this snakemake installation headache step by step—conda dependency conflicts and JSON parsing errors are super common, but we've got solid fixes to try:
1. Resolve the JSON Parsing Error First
That ValueError: Expecting : delimiter is almost always caused by corrupted conda cache files. Let's clear them out to start fresh:
conda clean --all -y
This command deletes all cached packages and index files, so conda will fetch uncorrupted, up-to-date data next time you run an install.
2. Create a Fresh Conda Environment (Most Reliable Fix)
Your existing environment likely has tangled dependencies, and Python 3.4.5 is quite outdated—newer snakemake releases don't even support Python 3.4 anymore. Let's build a clean environment tailored for snakemake:
- Create a new environment with a snakemake-compatible Python version (3.6–3.9 work perfectly):
conda create -n snakemake_env python=3.8 -y - Activate the new environment (CentOS 7 may require
sourcefor older conda versions):source activate snakemake_env - Install snakemake with properly ordered channels (conda-forge first to avoid dependency clashes):
conda install -c conda-forge -c bioconda snakemake -y
3. Fix the Backports Dependency Conflict Directly
If you absolutely need to use your existing environment, try forcing a compatible version of backports.functools_lru_cache that plays nice with snakemake:
conda install -c bioconda -c conda-forge snakemake backports.functools_lru_cache=1.5 -y
Version 1.5 is a known compatible release for older snakemake versions that support Python 3.4.
4. Configure Conda Channel Priority
Misconfigured channel order often leads to pulling incompatible package versions. Set up your channels to prioritize reliability:
conda config --add channels conda-forge conda config --add channels bioconda conda config --add channels defaults conda config --set channel_priority strict
This ensures conda picks packages from the highest-priority channel first, cutting down on cross-channel dependency conflicts.
A quick heads-up: Python 3.4 is end-of-life, so moving to a newer Python version (even just in a conda environment) will save you from tons of future dependency headaches.
内容的提问来源于stack exchange,提问作者Nikita Vlasenko

