"ImportError: No module named dateutil.rrule" from beta_diversity_through_plots.py

2,595 views
Skip to first unread message

Daniel Smith

unread,
Apr 4, 2013, 2:28:31 PM4/4/13
to qiime...@googlegroups.com
Whenever I run beta_diversity_through_plots.py, I get the following error output:

-----------------------------------------------------------------------------------
*** ERROR RAISED DURING STEP: Make 2D plots (continuous coloring, weighted_unifrac)
Command run was:
 /usr/local/bin/qiime-1.6.0/python-2.7.3-release/bin/python /usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin/make_2d_plots.py -p 09_beta_diversity/prefs.txt -i 09_beta_diversity/weighted_unifrac_pc.txt -o 09_beta_diversity/weighted_unifrac_2d_continuous/ -m MappingFile.txt 
Command returned exit status: 1
Stdout:

Stderr
Traceback (most recent call last):
  File "/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin/make_2d_plots.py", line 22, in <module>
    from qiime.make_2d_plots import generate_2d_plots
  File "/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/lib/qiime/make_2d_plots.py", line 17, in <module>
    from matplotlib.pylab import *
  File "/usr/local/bin/qiime-1.6.0/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/pylab.py", line 221, in <module>
    from matplotlib import mpl  # pulls in most modules
  File "/usr/local/bin/qiime-1.6.0/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/mpl.py", line 3, in <module>
    from matplotlib import axes
  File "/usr/local/bin/qiime-1.6.0/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/axes.py", line 19, in <module>
    import matplotlib.dates as mdates
  File "/usr/local/bin/qiime-1.6.0/matplotlib-1.1.0-release/lib/python2.7/site-packages/matplotlib/dates.py", line 119, in <module>
    from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \
ImportError: No module named dateutil.rrule
-----------------------------------------------------------------------------------


I tried running "sudo apt-get install python-dateutil" to no avail (the library was already installed and up to date)

The following parameters were in the log file generated by beta_diversity_through_plots.py:


-----------------------------------------------------------------------------------
QIIME version: 1.6.0

qiime_config values:
blastmat_dir	/usr/local/bin/qiime-1.6.0/blast-2.2.22-release/data
sc_queue	all.q
pynast_template_alignment_fp	/usr/local/bin/qiime-1.6.0/core_set_aligned.fasta.imputed
cluster_jobs_fp	/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin/start_parallel_jobs.py
assign_taxonomy_reference_seqs_fp	/usr/local/bin/qiime-1.6.0/gg_otus-12_10-release/rep_set/97_otus.fasta
torque_queue	friendlyq
template_alignment_lanemask_fp	/usr/local/bin/qiime-1.6.0/lanemask_in_1s_and_0s
jobs_to_start	1
cloud_environment	False
qiime_scripts_dir	/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin
denoiser_min_per_core	50
working_dir	/tmp/
python_exe_fp	/usr/local/bin/qiime-1.6.0/python-2.7.3-release/bin/python
temp_dir	/tmp/
blastall_fp	/usr/local/bin/qiime-1.6.0/blast-2.2.22-release/bin/blastall
seconds_to_sleep	60
assign_taxonomy_id_to_taxonomy_fp	/usr/local/bin/qiime-1.6.0/gg_otus-12_10-release/taxonomy/97_otu_taxonomy.txt
-----------------------------------------------------------------------------------


Any ideas?

Thanks,
   -Dan

Daniel Smith

unread,
Apr 4, 2013, 2:33:21 PM4/4/13
to qiime...@googlegroups.com
I'm seeing the exact same error message when running summarize_taxa_through_plots.py, if that help narrow things down.

Tony Walters

unread,
Apr 4, 2013, 2:39:33 PM4/4/13
to qiime...@googlegroups.com
Hello Daniel,

Jai had a solution for this (https://groups.google.com/forum/?fromgroups=#!topic/qiime-forum/GRkmnT6NXWQ), you may need to install pip to follow these instructions though.

-Tony


--
 
---
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/groups/opt_out.
 
 

Daniel Smith

unread,
Apr 4, 2013, 2:54:26 PM4/4/13
to qiime...@googlegroups.com
Hi Tony,

Jai's solution isn't working for me:


---------------------------------------------------------------
bash$ pip install python-dateutil
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from python-dateutil)
Cleaning up...

bash$ pip install --upgrade python-dateutil
Requirement already up-to-date: python-dateutil in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: six in /usr/local/lib/python2.7/dist-packages (from python-dateutil)
Cleaning up...

bash$ sudo pip install python-dateutil
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from python-dateutil)
Cleaning up...

bash$ sudo pip install --upgrade python-dateutil
Requirement already up-to-date: python-dateutil in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: six in /usr/local/lib/python2.7/dist-packages (from python-dateutil)
Cleaning up...

bash$ beta_diversity_through_plots.py -i 06_otu_table/otu_table_even.biom -t 08_phylogeny/rep_set.tre -m MappingFile.txt -o 09_beta_diversity
Traceback (most recent call last):
  File "/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin/beta_diversity_through_plots.py", line 165, in <module>
    main()
  File "/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin/beta_diversity_through_plots.py", line 162, in main
    status_update_callback=status_update_callback)
  File "/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/lib/qiime/workflow.py", line 867, in run_beta_diversity_through_plots
    close_logger_on_success=close_logger_on_success)
  File "/usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/lib/qiime/workflow.py", line 135, in call_commands_serially
    raise WorkflowError, msg
qiime.workflow.WorkflowError: 

Tony Walters

unread,
Apr 4, 2013, 3:04:00 PM4/4/13
to qiime...@googlegroups.com
Hello Daniel,

You may have to try installing this manually (https://pypi.python.org/pypi/python-dateutil/), and then open a new terminal and see if that fixes the error.  What versions of the software are you using btw (output of print_qiime_config.py)?

Daniel Smith

unread,
Apr 4, 2013, 3:06:43 PM4/4/13
to qiime...@googlegroups.com
Hi Tony,

Thanks for the suggestion. I'll try re-installing dateutil and see what happens.

Here is the output of print_qiime_config.py:


-----------------------------------------------------------------
bash$ print_qiime_config.py

System information
==================
         Platform:      linux2
   Python version:      2.7.3 (default, Dec 20 2012, 19:37:26)  [GCC 4.6.3]
Python executable:      /usr/local/bin/qiime-1.6.0/python-2.7.3-release/bin/python

Dependency versions
===================
                     PyCogent version:  1.5.3
                        NumPy version:  1.5.1
                   matplotlib version:  1.1.0
                  biom-format version:  1.1.1
                QIIME library version:  1.6.0
                 QIIME script version:  1.6.0
        PyNAST version (if installed):  1.2
RDP Classifier version (if installed):  rdp_classifier-2.2.jar
          Java version (if installed):  1.6.0_27

QIIME config values
===================
                     blastmat_dir:      /usr/local/bin/qiime-1.6.0/blast-2.2.22-release/data
                         sc_queue:      all.q
      topiaryexplorer_project_dir:      None
     pynast_template_alignment_fp:      /usr/local/bin/qiime-1.6.0/core_set_aligned.fasta.imputed
                  cluster_jobs_fp:      /usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin/start_parallel_jobs.py
pynast_template_alignment_blastdb:      None
assign_taxonomy_reference_seqs_fp:      /usr/local/bin/qiime-1.6.0/gg_otus-12_10-release/rep_set/97_otus.fasta
                     torque_queue:      friendlyq
              qiime_test_data_dir:      None
   template_alignment_lanemask_fp:      /usr/local/bin/qiime-1.6.0/lanemask_in_1s_and_0s
                    jobs_to_start:      1
                cloud_environment:      False
                qiime_scripts_dir:      /usr/local/bin/qiime-1.6.0/qiime-1.6.0-release/bin
            denoiser_min_per_core:      50
                      working_dir:      /tmp/
                    python_exe_fp:      /usr/local/bin/qiime-1.6.0/python-2.7.3-release/bin/python
                         temp_dir:      /tmp/
                      blastall_fp:      /usr/local/bin/qiime-1.6.0/blast-2.2.22-release/bin/blastall
                 seconds_to_sleep:      60
assign_taxonomy_id_to_taxonomy_fp:      /usr/local/bin/qiime-1.6.0/gg_otus-12_10-release/taxonomy/97_otu_taxonomy.txt
-----------------------------------------------------------------

Jai Ram Rideout

unread,
Apr 4, 2013, 3:16:13 PM4/4/13
to qiime...@googlegroups.com
Hi Daniel,

This is likely installing python-dateutil using a different python executable than the one that's being used for QIIME. Can you try running the following command:

which pip

This will show you where your pip executable is. Then:

sudo /usr/local/bin/qiime-1.6.0/python-2.7.3-release/bin/python /path/to/your/pip/executable install python-dateutil

where you've replaced /path/to/your/pip/executable with the path given by the 'which pip' command. Not sure if this will do the trick, but it's worth a shot.

-Jai

Daniel Smith

unread,
Apr 4, 2013, 3:28:59 PM4/4/13
to qiime...@googlegroups.com
Hi Jai and Tony,

Thanks for all your help. The manual re-install of dateutil didn't work, but while I was poking around I noticed this:

------------------------------------------------
bash$ locate rrule.py
/usr/local/bin/qiime-1.5.0/matplotlib-1.1.0-release/lib/python2.7/site-packages/dateutil/rrule.py
/usr/local/bin/qiime-1.5.0/matplotlib-1.1.0-release/lib/python2.7/site-packages/dateutil/rrule.pyc
/usr/share/pyshared/dateutil/rrule.py
------------------------------------------------

That is, these is no rrule.py in my qiime-1.6.0 directory, though there is one in my prior 1.5.0 installation of QIIME.

So, I tried this:

------------------------------------------------
mv /usr/local/bin/qiime-1.6.0/matplotlib-1.1.0-release /usr/local/bin/qiime-1.6.0/matplotlib-1.1.0-release_backup
ln -s /usr/local/bin/qiime-1.5.0/matplotlib-1.1.0-release /usr/local/bin/qiime-1.6.0/matplotlib-1.1.0-release
------------------------------------------------

And now beta_diversity_through_plots.py run perfectly. Not an ideal solution, but hey if it works, it works.

I think I'm good to go, but if you want more info about the contents of the qiime-1.6.0/matplotlib-1.1.0-release just let me know.

Thanks!
   -Dan
Reply all
Reply to author
Forward
0 new messages