<p>Python (whether installed with conda or not) will prefer packages installed in your home directory unless you tell it not to. This is a little known secret about using a virtualenv, actually, since internally those tell python to ignore everything in your home directory. Within conda, there's long been a debate about whether python (and also R) should continue looking for packages in the normal places or only within a conda environment. Since it would likely break many people's workflows, it's been decided to allow the normal language features of looking for packages not just within conda envs but also in the normal system and user locations. For python in particular you can disable this as follows:</p>

<pre><code>PYTHONNOUSERSITE=True snakemake ...
</code></pre>

<p>Then only the packages installed within your conda environment will be used.</p>

CC BY-SA 4.0
2020-04-17T09:19:39.240Z
This is very useful, thanks a lot @DevonRyan! I solved the problem by uninstalling the external package (which I found thanks to your comment above). But for the future I will consider using `PYTHONNOUSERSITE=True`.
mrhd
CC BY-SA 4.0
2020-04-17T09:21:18.640Z
https://xkcd.com/1987/
mrhd
CC BY-SA 4.0
2020-04-17T09:15:43.370Z
2020-04-17T09:15:43.370Z
Devon Ryan
<p>I would like to use the <code>--default-resources</code> parameter for profiles which is available in later versions of <a href="https://snakemake.readthedocs.io/en/stable/index.html" rel="nofollow noreferrer">snakemake</a>.</p>

<p>To install snakemake, I created a new conda environment:</p>

<p><code>conda create -n snakemake -c conda-forge -c bioconda snakemake</code></p>

<p>The currently installed version is listed as 5.14:</p>

<pre><code>$ conda activate snakemake
(snakemake)$ conda list | grep snakemake
# packages in environment at /home/uvi/be/hde/.conda/envs/snakemake:
snakemake                 5.14.0                        0    bioconda
snakemake-minimal         5.14.0                     py_1    bioconda
</code></pre>

<p>However, command line tool says it is on version 5.1.4:</p>

<pre><code>(snakemake)$ snakemake --version
5.1.4
</code></pre>

<p>This version does not know the new parameter <code>--default-resources</code> yet. So it gives an error when using it</p>

<blockquote>
  <p>snakemake: error: unrecognized arguments: --default-resources partition = "thin-shared"</p>
</blockquote>

<p>I already checked that I'm running the executable from inside the environment, rather than a different, external one:</p>

<pre><code>(snakemake)<span class="math-container">$ which snakemake
~/.conda/envs/snakemake/bin/snakemake
(snakemake)$</span> $(which snakemake) --version
5.1.4
</code></pre>

CC BY-SA 4.0
2020-04-17T08:57:17.337Z
What is the output of `python -c "import snakemake; print(snakemake.__file__)"`?
Devon Ryan
CC BY-SA 4.0
2020-04-17T09:04:16.497Z
`/home/uvi/be/hde/.local/lib/python3.6/site-packages/snakemake/__init__.py` Hah! That's not the version inside the conda environment.
mrhd
<snakemake><conda>
conda doesn't install latest version of snakemake
# conda doesn't install latest version of snakemake

(Asked by: username_0 on 2020-04-17)

I would like to use the --default-resources parameter for profiles which is available in later versions of snakemake.
To install snakemake, I created a new conda environment:
conda create -n snakemake -c conda-forge -c bioconda snakemake
The currently installed version is listed as 5.14:
$ conda activate snakemake
(snakemake)$ conda list | grep snakemake
# packages in environment at /home/uvi/be/hde/.conda/envs/snakemake:
snakemake                 5.14.0                        0    bioconda
snakemake-minimal         5.14.0                     py_1    bioconda

However, command line tool says it is on version 5.1.4:
(snakemake)$ snakemake --version
5.1.4

This version does not know the new parameter --default-resources yet. So it gives an error when using it

snakemake: error: unrecognized arguments: --default-resources partition = "thin-shared"

I already checked that I'm running the executable from inside the environment, rather than a different, external one:
(snakemake)$ which snakemake
~/.conda/envs/snakemake/bin/snakemake
(snakemake)$ $(which snakemake) --version
5.1.4

**Tags:** snakemake, conda
> **Comments:**
> **username_1**: What is the output of `python -c "import snakemake; print(snakemake.__file__)"`?  
> **username_0**: `/home/uvi/be/hde/.local/lib/python3.6/site-packages/snakemake/__init__.py` Hah! That's not the version inside the conda environment.  

---

## 1 answers

### Answer by username_1 on 2020-04-17. Score: 4 | Accepted answer

Python (whether installed with conda or not) will prefer packages installed in your home directory unless you tell it not to. This is a little known secret about using a virtualenv, actually, since internally those tell python to ignore everything in your home directory. Within conda, there's long been a debate about whether python (and also R) should continue looking for packages in the normal places or only within a conda environment. Since it would likely break many people's workflows, it's been decided to allow the normal language features of looking for packages not just within conda envs but also in the normal system and user locations. For python in particular you can disable this as follows:
PYTHONNOUSERSITE=True snakemake ...

Then only the packages installed within your conda environment will be used.

> **Comments:**
> **username_0**: This is very useful, thanks a lot @DevonRyan! I solved the problem by uninstalling the external package (which I found thanks to your comment above). But for the future I will consider using `PYTHONNOUSERSITE=True`.  
> **username_0**: https://xkcd.com/1987/  

---

