Error: No module named qcli

1,774 views
Skip to first unread message

Yongjie Zhang

unread,
Sep 8, 2014, 8:52:30 PM9/8/14
to qiime...@googlegroups.com
Hello all,
When I use workflow scripts, there is "Error: No module named qcli". When I used them before, no such error occurred. The result of print_qiime_config.py is also shown below. Can you tell how to fix it? Thanks.
Yongjie

[yongjie@vector Rodent_sl_out]$ core_diversity_analyses.py -i otus_table_tax_AbunFilter.biom -m mapping.txt -o core_diversity_Sex -e 7567 -c Sex -a -O 64 -p core_diversity_param.txt

Traceback (most recent call last):

  File "/global/home/groups/software/modules/qiime/1.8.0/bin/core_diversity_analyses.py", line 183, in <module>

    main()    

  File "/global/home/groups/software/modules/qiime/1.8.0/bin/core_diversity_analyses.py", line 180, in main

    status_update_callback=status_update_callback)

  File "/global/home/groups/software/modules/qiime/1.8.0/lib/qiime/workflow/core_diversity_analyses.py", line 227, in run_core_diversity_analyses

    status_update_callback=status_update_callback)

  File "/global/home/groups/software/modules/qiime/1.8.0/lib/qiime/workflow/downstream.py", line 187, in run_beta_diversity_through_plots

    close_logger_on_success=close_logger_on_success)

  File "/global/home/groups/software/modules/qiime/1.8.0/lib/qiime/workflow/util.py", line 116, in call_commands_serially

    raise WorkflowError, msg

qiime.workflow.util.WorkflowError: 


*** ERROR RAISED DURING STEP: Beta Diversity (bray_curtis)

Command run was:

 python /global/home/groups/software/modules/qiime/1.8.0/bin//parallel_beta_diversity.py -i core_diversity_Sex/table_even7567.biom -o core_diversity_Sex/bdiv_even7567/ --metrics bray_curtis -T --jobs_to_start 64

Command returned exit status: 1

Stdout:


Stderr

Traceback (most recent call last):

  File "/global/home/groups/software/modules/qiime/1.8.0/bin//parallel_beta_diversity.py", line 15, in <module>

    from qiime.util import parse_command_line_parameters

  File "/global/home/groups/software/modules/qiime/1.8.0/lib/qiime/util.py", line 69, in <module>

    from qcli import (parse_command_line_parameters,

ImportError: No module named qcli


[yongjie@vector Rodent_sl_out]$ print_qiime_config.py


System information

==================

         Platform: linux2

   Python version: 2.7.6 (default, Jan 22 2014, 16:14:46)  [GCC 4.6.0]

Python executable: /global/home/groups/software/modules/python/2.7.6/bin/python


Dependency versions

===================

                     PyCogent version: 1.5.3

                        NumPy version: 1.7.1

                   matplotlib version: 1.2.0

                  biom-format version: 1.2.0

                         qcli version: 0.1.0

                QIIME library version: 1.8.0

                 QIIME script version: 1.8.0

        PyNAST version (if installed): 1.2.2

                      Emperor version: 0.9.3

RDP Classifier version (if installed): rdp_classifier-2.2.jar

          Java version (if installed): 1.7.0_01


QIIME config values

===================

                     blastmat_dir: None

                         sc_queue: all.q

      topiaryexplorer_project_dir: None

     pynast_template_alignment_fp: /global/home/groups/software/modules/qiime/1.8.0/data/core_set_aligned.fasta.imputed

                  cluster_jobs_fp: None

pynast_template_alignment_blastdb: None

assign_taxonomy_reference_seqs_fp: /global/home/groups/software/modules/qiime/1.8.0/data/gg_13_8_otus/rep_set/97_otus.fasta

                     torque_queue: friendlyq

   template_alignment_lanemask_fp: /global/home/groups/software/modules/qiime/1.8.0/data/lanemask_in_1s_and_0s

                    jobs_to_start: 1

                cloud_environment: False

                qiime_scripts_dir: /global/home/groups/software/modules/qiime/1.8.0/bin/

            denoiser_min_per_core: 50

                      working_dir: None

                    python_exe_fp: python

                         temp_dir: /tmp/

                      blastall_fp: blastall

                 seconds_to_sleep: 2

assign_taxonomy_id_to_taxonomy_fp: /global/home/groups/software/modules/qiime/1.8.0/data/gg_13_8_otus/taxonomy/97_otu_taxonomy.txt

Katherine Amato

unread,
Sep 9, 2014, 11:44:59 AM9/9/14
to qiime...@googlegroups.com
Hi Yongjie,

This is odd. When you ran print_qiime_config.py the qcli command shows on his installation path, meaning that qcli is installed, but your command says it's not. One of our developers suggests closing all of your terminals, opening a new one and seeing if print_qiime_config.py says that qcli is installed.

Can you also post the results of running?:

echo $PYTHONPATH

The guess is that you have multiple terminals open, and in one of them you have the QIIME source and not in the other. By closing all of them and opening a new one, we make sure that your environment is as clean as possible.

Let us know what happens.

Best,
Katie

Yongjie Zhang

unread,
Sep 9, 2014, 4:31:47 PM9/9/14
to qiime...@googlegroups.com
Dear Katie,
I closed all terminals and opened a new one to redo everything, but the issue is not resolved.  I attached below the implementing of the relevant commands. Thanks for your help in advance.
Yongjie

[yongjie@vector Rodent_sl_out]$ module load qiime/1.8.0 

[yongjie@vector Rodent_sl_out]$ core_diversity_analyses.py -i otus_table_tax_AbunFilter.biom -m mapping.txt -o core_diversity_Sex -e 7567 -c Sex

Traceback (most recent call last):

  File "/global/home/groups/software/modules/qiime/1.8.0/bin/core_diversity_analyses.py", line 183, in <module>

    main()    

  File "/global/home/groups/software/modules/qiime/1.8.0/bin/core_diversity_analyses.py", line 180, in main

    status_update_callback=status_update_callback)

  File "/global/home/groups/software/modules/qiime/1.8.0/lib/qiime/workflow/core_diversity_analyses.py", line 227, in run_core_diversity_analyses

    status_update_callback=status_update_callback)

  File "/global/home/groups/software/modules/qiime/1.8.0/lib/qiime/workflow/downstream.py", line 187, in run_beta_diversity_through_plots

    close_logger_on_success=close_logger_on_success)

  File "/global/home/groups/software/modules/qiime/1.8.0/lib/qiime/workflow/util.py", line 116, in call_commands_serially

    raise WorkflowError, msg

qiime.workflow.util.WorkflowError: 


*** ERROR RAISED DURING STEP: Beta Diversity (weighted_unifrac)

Command run was:

 python /global/home/groups/software/modules/qiime/1.8.0/bin//beta_diversity.py -i core_diversity_Sex/table_even7567.biom -o core_diversity_Sex/bdiv_even7567/ --metrics weighted_unifrac 

Command returned exit status: 1

Stdout:


Stderr

Traceback (most recent call last):

  File "/global/home/groups/software/modules/qiime/1.8.0/bin//beta_diversity.py", line 13, in <module>

    from qiime.util import make_option, parse_command_line_parameters

[yongjie@vector Rodent_sl_out]$ echo $PYTHONPATH

/global/home/groups/software/modules/qiime/1.8.0/lib/:/global/home/groups/software/modules/biom-format/1.2.0/lib/python2.7/site-packages:/global/home/groups/software/modules/pyqi/0.2.0/lib/python2.7/site-packages:/global/home/groups/software/modules/pycogent/1.5.3/lib/python2.7/site-packages:/global/home/groups/software/modules/matplotlib/1.2.0/lib/python2.7/site-packages:/global/home/groups/software/modules/numpy/1.7.1/lib/python2.7/site-packages

Adam robbins-pianka

unread,
Sep 9, 2014, 4:46:53 PM9/9/14
to qiime...@googlegroups.com
Not sure I know the answer to this one, but do you know how QIIME was installed on your system?  Can you copy the result of the following commands:

python -c 'import qcli; print qcli; print qcli.__version__'
/global/home/groups/software/modules/python/2.7.6/bin/python -c 'import qcli; print qcli; print qcli.__version__'
head -1 `which core_diversity_analyses.py`

I'm wondering if there is some problem with multiple python executables being used.

Best,
Adam

--

---
You received this message because you are subscribed to the Google Groups "Qiime Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qiime-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yongjie Zhang

unread,
Sep 9, 2014, 5:00:04 PM9/9/14
to qiime...@googlegroups.com
Dear Adam,
Below is the results of implementing your listed commands. It shows no module qcli. I'm using qiime 1.8.0 on the server and the same scripts worked well before. I googled and got the link https://github.com/biocore/qiime/issues/1100. Do you think qcli has to be reinstalled?
Thanks.
Yongjie

[yongjie@vector Rodent_sl_out]$ python -c 'import qcli

> print qcli

> print qcli.__version__' /global/home/groups/software/modules/python/2.7.6/bin/python -c 'import qcli

> print qcli

> print qcli.__version__' head -1 `which core_diversity_analyses.py`

Traceback (most recent call last):

  File "<string>", line 1, in <module>

Adam robbins-pianka

unread,
Sep 9, 2014, 5:10:28 PM9/9/14
to qiime...@googlegroups.com
Hello again,

The output doesn't look quite right to me; can you try running the commands again?  To be clear, those are three separate commands, each of which should be executed from bash prompt.  Perhaps some formatting will make it more clear, sorry about that!

First command:
$ python -c 'import qcli; print qcli; print qcli.__version__'

Second command:
$ /global/home/groups/software/modules/python/2.7.6/bin/python -c 'import qcli; print qcli; print qcli.__version__'

Third command:
$ head -1 `which core_diversity_analyses.py`

Best,
Adam

--

Yongjie Zhang

unread,
Sep 9, 2014, 5:15:33 PM9/9/14
to qiime...@googlegroups.com
Hi Adam, here is the result. 

[yongjie@vector Rodent_sl_out]$ python -c 'import qcli; print qcli; print qcli.__version__'

Traceback (most recent call last):

  File "<string>", line 1, in <module>

ImportError: No module named qcli

[yongjie@vector Rodent_sl_out]$ /global/home/groups/software/modules/python/2.7.6/bin/python -c 'import qcli; print qcli; print qcli.__version__'

<module 'qcli' from '/global/home/groups/software/modules/python/2.7.6/lib/python2.7/site-packages/qcli/__init__.pyc'>

0.1.0

[yongjie@vector Rodent_sl_out]$ head -1 `which core_diversity_analyses.py`

#!/global/home/groups/software/modules/python/2.7.6/bin/python

Adam robbins-pianka

unread,
Sep 9, 2014, 5:17:00 PM9/9/14
to qiime...@googlegroups.com
Thanks!  Now we're getting somewhere.  Lastly, can you execute this from the bash prompt:

$ which python

Best,
Adam

--

Yongjie Zhang

unread,
Sep 9, 2014, 5:19:05 PM9/9/14
to qiime...@googlegroups.com
 Here is the result.

[yongjie@vector Rodent_sl_out]$ which python

/global/software/centos-5.x86_64/modules/python/2.7.1/bin/python

Yongjie Zhang

unread,
Sep 10, 2014, 12:17:24 PM9/10/14
to qiime...@googlegroups.com
Hello Adam,
Have you figured out how to fix the error?
Best,
Yongjie

Adam robbins-pianka

unread,
Sep 10, 2014, 12:35:58 PM9/10/14
to qiime...@googlegroups.com
Hey,

Sorry for the delay. The issue is that the python executable that is executed when you type "python" into your terminal is /global/software/centos-5.x86_64/modules/python/2.7.1/bin/python, and it has one set of installed packages.  When you simply execute a script (e.g., when you type "core_diversity_analyses.py ..." into your terminal), the first line of the script tells the system which python executable to use.  In this case, it is telling the system to use /global/home/groups/software/modules/python/2.7.6/bin/python.  This python executable also has a set of installed packages, which is distinct of the set used for the other executable.

Basically, pyqi is installed for the second one, but not for the first.  This shouldn't be a problem, since your QIIME config says that the python executable to be used is the second one, but this is being ignored in this particular case, since the command being run is this:

python /global/home/groups/software/modules/qiime/1.8.0/bin//parallel_beta_diversity.py -i core_diversity_Sex/table_even7567.biom -o core_diversity_Sex/bdiv_even7567/ --metrics bray_curtis -T --jobs_to_start 64

Thus using the first python executable, which does not have pyqi installed.

The solution is to use /global/home/groups/software/modules/python/2.7.6/bin/python as your python executable.  It looks like you have modules installed on your system, so you can probably do something like

module load python.2.7.6

or something similar (type "module avail" to se available modules, and load the one corresponding to python 2.7.6). Then, execute

which python

Again to verify that it is now using /global/home/groups/software/modules/python/2.7.6/bin/python.  If that works, then you should try executing core_diversity_analyses again!

Best,
Adam

--

Yongjie Zhang

unread,
Sep 10, 2014, 4:22:41 PM9/10/14
to qiime...@googlegroups.com
Dear Adam,
Thanks very much.
It works now. The error was really caused by python versions.
Best,
Yongjie
Reply all
Reply to author
Forward
0 new messages