Reputation: 11
I am trying to use the VCFPy package in Python3. Here are the first two lines of my program:
import vcfpy
reader = vcfpy.Reader("example_file.vcf")
and I get the error message:
File "/usr/local/lib/python3.10/dist-packages/vcfpy/parser.py", line 701, in init self._line = stream.readline() # trailing '\n' AttributeError: 'str' object has no attribute 'readline'
The program is running under Ubuntu 22.04.
Upvotes: 0
Views: 89
Reputation: 574
You might want to use vcfpy.Reader.from_path('example_file.vcf')
.
The Reader constructor accepts a stream, not a filename.
Upvotes: 0