rvalieris / parallel-fastq-dump

parallel fastq-dump wrapper
MIT License
265 stars 33 forks source link

temp file attribute error #9

Closed slschnorr closed 6 years ago

slschnorr commented 6 years ago

Hi, apologies that this is probably user error in my environment, but when I attempt to run parallel-fastq-dump using this command:

parallel-fastq-dump --sra-id SRR1930123 --threads 4 --outdir ./ --split-files --gzip

I get this error (with traceback):

Traceback (most recent call last): File "/usr/bin/parallel-fastq-dump", line 100, in <module> main() File "/usr/bin/parallel-fastq-dump", line 93, in main pfd(args, si, extra_args, n_spots) File "/usr/bin/parallel-fastq-dump", line 12, in pfd tmp_dir = tempfile.TemporaryDirectory(prefix="pfd_",dir=args.tmpdir) AttributeError: 'module' object has no attribute 'TemporaryDirectory'

I'm running this in centos, and I noticed that the shebang of the parallel-fastq-dump script is calling for python2: #!/usr/bin/python2 Is this an error? I installed with pip install, and version is 0.6.2. Thanks for your help!

rvalieris commented 6 years ago

hello,

the problem is that TemporaryDirectory function only exists in python 3. can you use python3 instead of python2 ?

if not, one workaround would be to install the backports.tempfile package and then replace import tempfile on the script with from backports import tempfile.

slschnorr commented 6 years ago

Thanks for the fast response! I just installed python3, so I will change the shebang on your file to: #!/usr/bin/python3 or is it instead correct to do: #!/usr/bin/env python3 ?

rvalieris commented 6 years ago

both work fine, given that python3 is in /usr/bin, but the second is generally better.

slschnorr commented 6 years ago

Great, I think it is working now. Thank you for your help!

rvalieris commented 6 years ago

no problem ! glad I could help.