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

ModuleNotFoundError: No module named 'dlisio.dlis' #336

Closed
raquelsilva opened this issue Mar 4, 2021 · 3 comments
Closed

ModuleNotFoundError: No module named 'dlisio.dlis' #336

raquelsilva opened this issue Mar 4, 2021 · 3 comments

Comments

@raquelsilva
Copy link

I am trying to fetch the units of the curves but I am receiving the error:


ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from dlisio.dlis.utils import vector
2 Channel.attributes['UNITS'] = vector
3 with dlisio.dlis.load('file.dlis') as (f, *_):
4 ch = f.object('CHANNEL', 'TDEP')
5 ch.units

ModuleNotFoundError: No module named 'dlisio.dlis'

@ErlendHaa
Copy link
Contributor

ErlendHaa commented Mar 4, 2021

Hi there!

What version of dlisio do you use? The submodule 'dlisio.dlis' was introduced 736d545, which it not a part of the newest stable release (v0.2.6). The above code should work fine if you build dlisio from source, while if you fetch dlisio from pip, your script should be:

import dlisio
from dlisio.plumbing import Channel, Vector

Channel.attributes['UNITS'] = vector
with dlisio.load('file.dlis') as (f, *_):
    ch = f.object('CHANNEL', 'TDEP')
    ch.units

The docs for the stable version (pip): https://dlisio.readthedocs.io/en/stable/
The docs for latest (building from source): https://dlisio.readthedocs.io/en/latest/

As this suggests the next stable release of dlisio will be a quite heavy break of the API from previous versions due to this module restructuring, and then your code will be the correct one. I'm sorry for the inconvenience such breaking changes impose, we try to keep them at a minimum. The reasoning for the restructuring is the introduction of a LIS parser. Hence the new submodules dlisio.dlis and dlisio.lis

@ErlendHaa
Copy link
Contributor

dlisio v0.3.0 is now available on pip. Please refer to #339 on how to upgrade your scripts to work with the new version.

@raquelsilva
Copy link
Author

raquelsilva commented Mar 9, 2021 via email

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