Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LooseVersion' object has no attribute 'version #300

Open
mabouelk opened this issue Jun 28, 2020 · 5 comments
Open

LooseVersion' object has no attribute 'version #300

mabouelk opened this issue Jun 28, 2020 · 5 comments

Comments

@mabouelk
Copy link

Any help!

Running ariba prepareref with:
/Users/mohamedabouelkhair/miniconda3/envs/ariba/bin/ariba prepareref --verbose -f ref_seqs.fa -m metadata.tsv --threads 1 PREPAREREF

Traceback (most recent call last):
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/bin/ariba", line 312, in
args.func(args)
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.6/site-packages/ariba/tasks/prepareref.py", line 9, in run
extern_progs, version_report_lines = versions.get_all_versions(using_spades=False)
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.6/site-packages/ariba/versions.py", line 21, in get_all_versions
extern_progs = external_progs.ExternalProgs(fail_on_error=False, using_spades=using_spades)
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.6/site-packages/ariba/external_progs.py", line 88, in init
if prog in min_versions and LooseVersion(version) < LooseVersion(min_versions[prog]):
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.6/distutils/version.py", line 52, in lt
c = self._cmp(other)
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.6/distutils/version.py", line 335, in _cmp
if self.version == other.version:
AttributeError: 'LooseVersion' object has no attribute 'version'

Something went wrong. See above for error message(s). Return code was 1

@markb729
Copy link

I encountered this too, which may be related to an error manifested in the bioconda version and/or an unknown "feature" lurking in the python 3.6 env. My solution was to create a python 3.8.3 env including gcc-4.8.5 (needed for ariba compilation and also includes zlib). Then install the package with pip3 install ariba to work as advertised.

@mabouelk
Copy link
Author

Great, it works. Thank you so much

@mabouelk
Copy link
Author

when I run

ariba test output

I got the following error, even the files are there. Should I specify the path?

The following reads file(s) were not found:
reads_1.fq
reads_2.fq
Cannot continue
Traceback (most recent call last):
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/bin/ariba", line 312, in
args.func(args)
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/site-packages/ariba/tasks/run.py", line 65, in run
c.run()
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/site-packages/ariba/clusters.py", line 612, in run
self._run()
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/site-packages/ariba/clusters.py", line 637, in _run
self._init_and_run_clusters()
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/site-packages/ariba/clusters.py", line 465, in _init_and_run_clusters
manager = multiprocessing.Manager()
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/multiprocessing/context.py", line 57, in Manager
m.start()
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/multiprocessing/managers.py", line 583, in start
self._address = reader.recv()
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/multiprocessing/connection.py", line 250, in recv
buf = self._recv_bytes()
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/multiprocessing/connection.py", line 414, in _recv_bytes
buf = self._recv(4)
File "/Users/mohamedabouelkhair/miniconda3/envs/ariba/lib/python3.8/multiprocessing/connection.py", line 383, in _recv
raise EOFError
EOFError

Something went wrong. See above for error message(s). Return code was 1

@markb729
Copy link

markb729 commented Jun 29, 2020

Paths are self-contained within the test and do not require specification. Nevertheless, try running ariba test output within the ariba directory. It should first prepare the input data:

Made output directory output. Copying test data files into it:

copied ref_seqs.fa
copied metadata.tsv
copied reads_1.fq
copied reads_2.fq

and then follow with prepareref:

Running ariba prepareref with:

/mnt/software/anaconda/envs/ariba_test/bin/ariba prepareref --verbose -f ref_seqs.fa -m metadata.tsv --threads 1 PREPAREREF

It will also output paths to external dependencies, including python packages. Pay attention to these and ariba will fail if any are absent.

ariba   2.14.5  /mnt/software/anaconda/envs/ariba_test/lib/python3.8/site-packages/ariba/__init__.py
bs4     4.9.1   /mnt/software/anaconda/envs/ariba_test/lib/python3.8/site-packages/bs4/__init__.py
dendropy        4.4.0   /mnt/software/anaconda/envs/ariba_test/lib/python3.8/site-packages/dendropy/__init__.py
pyfastaq        3.17.0  /mnt/software/anaconda/envs/ariba_test/lib/python3.8/site-packages/pyfastaq/__init__.py
pymummer        0.10.3  /mnt/software/anaconda/envs/ariba_test/lib/python3.8/site-packages/pymummer/__init__.py
pysam   0.16.0.1        /mnt/software/anaconda/envs/ariba_test/lib/python3.8/site-packages/pysam/__init__.py

Clearly the test is not completing input data preparation. If you run the test within the ariba folder and still get the error, then this is most likely a conda environment issue. I would recommend starting by updating your conda package and/or starting from a clean environment.

@rpetit3
Copy link
Contributor

rpetit3 commented Aug 19, 2020

Hi @mabouelk

I'm a bit late to the party but the error (AttributeError: 'LooseVersion' object has no attribute 'version') was due to the latest Bowtie2 version Bioconda not outputting the version number.

Here are some related issues:

BenLangmead/bowtie2#301

bioconda/bioconda-recipes#22836

I've submitted a PR to Bioconda to pin the Bowtie2 version to <2.4 which should fix things for you.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants