Closed AchyuthB closed 2 years ago
I'm unable to reproduce this. Can you provide a minimal code example + a full stack trace
Hi @ErlendHaa, Thank you for your reply. Below is the code snippet. The code formatting is not working here, hence I am pasting it without formatting.
The exception is throwing at this line for format_specs in logical_file.data_format_specs():
from dlisio import lis
def read_lis_file( input_file_path ):
try:
try:
physical_file = lis.load(input_file_path)
except Exception as e:
return
for logical_file in physical_file:
for format_specs in logical_file.data_format_specs():
pass
except Exception as e:
print(" - Script Warn: While processing logical file - " + str(e))
finally:
physical_file.close()
if __name__ == "__main__":
g_input_file = 'D:\FeedFiles\LIS\A\/164_07-_1_dwl_DWL_WIRE_1648905.lis'
try:
read_lis_file(g_input_file)
except Exception as e:
print(str(e))
exit(0)
Hi,
I still can't reproduce. I'm unsure why it can't find read_records
on lis_stream
, it's clearly there [1]
Do you install dlisio trough pip? If so, have you tried installing a fresh instance in an isolated env?
Hi,
Yes i installed dlisio using pip, actually i upgraded it with the below command.
pip install dlisio==0.3.5
May be the error is due to something specific in my environment. How do I test it isolated? Also, any other suggestions or recommendations which could get this resolved?
Should I try by uninstalling and re-installing the latest dlisio?
Thank you so much for your patience.
Regards, Achyuth
I would think so, yes. Try re-installing, maybe in a virtual env. I'm also curious about the -lisio
warnings you get. lisio was an old working name for the lis-parser, but it never got introduced upstream. Did you checkout some old version of a dlisio fork or something?
Hi @ErlendHaa,
I created a virtual environment and it worked as expected. Below are the steps i followed. Now have to figure out what is wrong with my environment.. :-(
I did not checkout any old version nor fork.
C:\>python -m venv D:\VirtualPython
D:\VirtualPython>D:\VirtualPython\Scripts\activate
(VirtualPython) D:\VirtualPython>py -m pip install dlisio
Hi,
It is working now.
1. I uninstalled all the packages
pip freeze > requirements.txt
pip uninstall -r requirements.txt
2. Deleted these folders
3. Then re-installed dlisio
pip install dlisio
Great!
Hi,
I upgraded the dlisio from version 0.3.4 to 0.3.5. Now I get error while calling "logical_file.data_format_specs()". It says
AttributeError("'dlisio.core.lis_stream' object has no attribute 'read_records'")
It was working fine with version 0.3.4.
Any help is highly appreciated.
Thanks Achyuth