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

temp file attribute error #9

Closed
slschnorr opened this issue Mar 6, 2018 · 5 comments
Closed

temp file attribute error #9

slschnorr opened this issue Mar 6, 2018 · 5 comments

Comments

@slschnorr
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@slschnorr
Copy link
Author

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

@rvalieris
Copy link
Owner

no problem ! glad I could help.

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

2 participants