Giter Site home page Giter Site logo

logical_file.data_format_specs() throwing AttributeError 'dlisio.core.lis_stream' object has no attribute 'read_records' about dlisio HOT 8 CLOSED

AchyuthB avatar AchyuthB commented on July 24, 2024
logical_file.data_format_specs() throwing AttributeError 'dlisio.core.lis_stream' object has no attribute 'read_records'

from dlisio.

Comments (8)

ErlendHaa avatar ErlendHaa commented on July 24, 2024 1

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?

from dlisio.

ErlendHaa avatar ErlendHaa commented on July 24, 2024

I'm unable to reproduce this. Can you provide a minimal code example + a full stack trace

from dlisio.

AchyuthB avatar AchyuthB commented on July 24, 2024

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)

from dlisio.

ErlendHaa avatar ErlendHaa commented on July 24, 2024

Hi,

I still can't reproduce. I'm unsure why it can't find read_records on lis_stream, it's clearly there [1]

.def( "read_records", &lis::iodevice::read_records )

Do you install dlisio trough pip? If so, have you tried installing a fresh instance in an isolated env?

from dlisio.

AchyuthB avatar AchyuthB commented on July 24, 2024

Hi,

Yes i installed dlisio using pip, actually i upgraded it with the below command.
pip install dlisio==0.3.5
image

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

from dlisio.

AchyuthB avatar AchyuthB commented on July 24, 2024

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

image

from dlisio.

AchyuthB avatar AchyuthB commented on July 24, 2024

Hi,

It is working now.

1. I uninstalled all the packages

pip freeze > requirements.txt
pip uninstall -r requirements.txt

2. Deleted these folders
image

3. Then re-installed dlisio
pip install dlisio

from dlisio.

ErlendHaa avatar ErlendHaa commented on July 24, 2024

Great!

from dlisio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.