obk
obk

Reputation: 750

Create clean conda environment

I want to make a blank/empty conda environment, but the newly created environment seems to be picking up packages from root or other environments. I have installed these packages (eg bedtools, bwa, etc) on the system as root and also into other conda environments, but want to make a clean one (for reproducibility).

Is this expected behavior? How can I debug this?

I'm (trying to) following this answer: https://stackoverflow.com/a/37216638/3294994

$ conda env create -n test-env python
$ source activate 
$ conda env export
name: test-env
channels:
- conda-forge
- biconda
- anaconda
- defaults
dependencies
...
python=3.6.2=0
bcftools=1.6=0
bedtools=2.26.0=0
bwa=0.7.15=1
...
picard=2.14=py36_0
...

Some information about the environment below:

$ conda info
Current conda install:

               platform : linux-64
          conda version : 4.3.27
       conda is private : False
      conda-env version : 4.3.27
    conda-build version : not installed
         python version : 3.6.1.final.0
       requests version : 2.14.2
       root environment : /home/obk/anaconda3  (writable)
    default environment : /home/obk/anaconda3/envs/tttest2
       envs directories : /home/obk/anaconda3/envs
                          /home/obk/.conda/envs
          package cache : /home/obk/anaconda3/pkgs
                          /home/obk/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : None
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.27 requests/2.14.2 CPython/3.6.1 Linux/3.13.0-132-generic debian/jessie/sid glibc/2.19
                UID:GID : 1001:1001
$ conda deactivate
$ conda info
Current conda install:

               platform : linux-64
          conda version : 4.3.27
       conda is private : False
      conda-env version : 4.3.27
    conda-build version : not installed
         python version : 3.6.1.final.0
       requests version : 2.14.2
       root environment : /home/obk/anaconda3  (writable)
    default environment : /home/obk/anaconda3
       envs directories : /home/obk/anaconda3/envs
                          /home/obk/.conda/envs
          package cache : /home/obk/anaconda3/pkgs
                          /home/obk/.conda/pkgs
           channel URLs : https://repo.continuum.io/pkgs/main/linux-64
                          https://repo.continuum.io/pkgs/main/noarch
                          https://repo.continuum.io/pkgs/free/linux-64
                          https://repo.continuum.io/pkgs/free/noarch
                          https://repo.continuum.io/pkgs/r/linux-64
                          https://repo.continuum.io/pkgs/r/noarch
                          https://repo.continuum.io/pkgs/pro/linux-64
                          https://repo.continuum.io/pkgs/pro/noarch
            config file : None
             netrc file : None
           offline mode : False
             user-agent : conda/4.3.27 requests/2.14.2 CPython/3.6.1 Linux/3.13.0-132-generic debian/jessie/sid glibc/2.19
                UID:GID : 1001:1001

And as an aside, the original problem I'm having is as follows:

$ source activate test-env
$ conda install jupyter
Fetching package metadata ...........
Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict:
  - imagemagick
  - jupyter
  - python 3.6*
Use "conda info <package>" to see the dependencies for each package.

I'm guessing this is because the newly created environment test-env has packages in it already...

Upvotes: 6

Views: 11470

Answers (1)

user10011505
user10011505

Reputation:

You can create a new env by typing conda create -n vEnv python

That will create a fresh environment. Btw this is the same as if you go into the GUI and hit the button create. So that env that you created will be placed under envs in the anaconda file available everywhere, so you can simply activate it by doing: conda activate vEnv

You can check the pip and conda packages (once you activate your environment) like this: pip list conda list

I hope it helps

Upvotes: 4

Related Questions