Trouble deciphering error "ImportError: No module named biom.table"

1,371 views
Skip to first unread message

kmshelef

unread,
Jun 7, 2012, 1:30:38 PM6/7/12
to Qiime Forum
Hi,

I've been using the Qiime developer version on our lab's server for
quite a while now, but when the switch was made to use ".biom" files
in lieu of OTU tables, Qiime returns the same error no matter what
script I try to run.

Please find an example of a command and the error below:

(qiime_dev)[kmt@adir qiime_dev]$ summarize_taxa.py -i ~/
Biogeo_analyses/Illumina_data/
otu_table_mc2_w_tax_no_pynast_filtered_even10828.biom -o ~/
Biogeo_analyses/Illumina_data/taxa_mapping/

Traceback (most recent call last):
File "/home/kmt/qiime_dev/bin/summarize_taxa.py", line 7, in
<module>
execfile(__file__)
File "/home/kmt/qiime_dev/src/qiime/scripts/summarize_taxa.py", line
16, in <module>
from qiime.util import parse_command_line_parameters
File "/home/kmt/qiime_dev/src/qiime/qiime/util.py", line 42, in
<module>
from biom.table import DenseTable
ImportError: No module named biom.table

Could you please let me know what this error means? I know my input
".biom" file is valid because I received it from someone in the Knight
lab!

Thanks so much in advance,
Katie

Daniel McDonald

unread,
Jun 7, 2012, 1:32:47 PM6/7/12
to qiime...@googlegroups.com
Hey Katie,

Could you please run print_qiime_config.py -t? My guess is that BIOM
is not installed on your system. Details can be found at
http://biom-format.org
-Daniel

kmshelef

unread,
Jun 7, 2012, 2:23:26 PM6/7/12
to Qiime Forum
HI Daniel,

Thanks so much for your quick response. I ran print_qiime_config.py -t
and received the same error:

Traceback (most recent call last):
File "/home/kmt/qiime_dev/bin/print_qiime_config.py", line 7, in
<module>
execfile(__file__)
File "/home/kmt/qiime_dev/src/qiime/scripts/print_qiime_config.py",
line 15, in <module>
from qiime.util import make_option
File "/home/kmt/qiime_dev/src/qiime/qiime/util.py", line 42, in
<module>
from biom.table import DenseTable
ImportError: No module named biom.table

Sorry for the silly question - I didn't realize biom-format-1.0.0
needed to be installed somewhere for the newer version of Qiime to
work. Could you please let me know where in the system this should be
installed relative to where our qiime_dev version is installed? Or do
both programs just need to be open simultaneously?

Thanks again!
Katie

Yoshiki Vázquez Baeza

unread,
Jun 7, 2012, 2:44:16 PM6/7/12
to qiime...@googlegroups.com
HI Katie,

The problem seems to be that python is not being able to see where the QIIME libraries and the BIOM-format libraries are in your system. This location depends on how the installation was made. A quick solution to this is to add the libraries to your PYTHONPATH, to do this you have to know where is you QIIME installation folder is.

In your ~/.bashrc or ~/.bash_profile add the following line:

export PYTHONPATH=/path_to_your_qiime_installation_folder/qiime/:$PYTHONPATH

By doing this and opening a new terminal, you should be able now to call the print_qiime_config.py script without a problem and that would let us know the status of all the other dependencies.

For the BIOM-format you are going to basically do the same:

export PYTHONPATH=/path_to_your_biom_installation_folder/python-code/:$PYTHONPATH

Still if you don't have installed yet the biom format, you may want to follow the instructions provided here:

http://biom-format.org/

Greg Caporaso

unread,
Jun 7, 2012, 4:44:18 PM6/7/12
to qiime...@googlegroups.com
One more point on this - note that BIOM 0.9.3 is the required version
of the biom-format project for QIIME 1.5.0. You can find that here:

https://github.com/downloads/biom-format/biom-format/biom-format-0.9.3.tgz

BIOM 1.0.0 has not been as extensively tested with QIIME 1.5.0 as BIOM
0.9.3 has - while you're unlikely to experience issues with 1.0.0, it
is possible.

Greg

Nathan

unread,
Aug 26, 2012, 11:44:39 PM8/26/12
to qiime...@googlegroups.com
HI Greg et al,

I have just upgraded my Ubuntu 10,04 install of Qiime to 1.5.0 and everything seemed fine till I ran the print_qiime_config.py -t which gave me the no module named biome.table error.  I then installed first biome (first 1.0.0 then 0.9.3) in my home directory but no luck. I see that it was suggested to add two new paths to the ./bashrc file. 
export PYTHONPATH=/path_to_your_qiime_installation_folder/qiime/:$PYTHONPATH
and
export PYTHONPATH=/path_to_your_biom_installation_folder/python-code/:$PYTHONPATH

I am a linux novice so I was hoping someone might elaborate on the syntax and placement of the line in each respective file. Do I just insert each line as is to the bottom of my ./bashrc file? (with the path to file obviously changed) or does it need to be preceded by a # ?

Apologies if this has been answered elsewhere but I have not found it.

Thanks for all the help!

Nathan


Nathan

Will Van Treuren

unread,
Aug 27, 2012, 9:47:50 AM8/27/12
to qiime...@googlegroups.com

Hi Nathan,
the location of the pythonpath export statement does not matter as long as its not being overwritten by another pythonpath declaration. A long as you have export before every pythonpath and :$PYTHONPATH  at the end you should be fine.
I suspect the problem is arising because the path to your biom installation might not be quite correct. Can you post your .bashrc file, and the directories qiime and biom are installed in?
Thanks,
Will
On Aug 26, 2012 9:44 PM,

> --
>  
>  
>  

Nathan

unread,
Aug 27, 2012, 11:10:33 PM8/27/12
to qiime...@googlegroups.com
Hi Will,
Thanks so much for the help. Cheers!

 /home/nathan/biom-format-0.9.3   and  /home/nathan/qiime_software


.bashrc

~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        # We have color support; assume it's compliant with Ecma-48
        # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
        # a case would tend to support setf rather than setaf.)
        color_prompt=yes
    else
        color_prompt=
    fi
fi
if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\$
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dirc$
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi
source /home/nathan/qiime_software/activate.sh

Will Van Treuren

unread,
Aug 28, 2012, 11:06:25 AM8/28/12
to qiime...@googlegroups.com

Hi Nathan,

At the very end of your .bashrc file add:

PYTHONPATH=/home/nathan/biom-format-0.9.3/python-code/:${PYTHONPATH}
export PYTHONPATH

PATH=/home/nathan/biom-format-0.9.3/scripts/:${PATH}
export PATH

then save the changes, and open a new terminal. Type:

convert_biom.py -h

if it gives you a help message we were successful, if it errors out something is still wrong. Let me know how it goes.

Will

Scripts/

> --
>  
>  
>  

Reply all
Reply to author
Forward
0 new messages