Page 1 of 1

module 'sdds' has no attribute 'SDDS'

Posted: 01 Mar 2022, 03:35
by Elaf_Musa
I imported a module in python as follow

import sdds

This module contains the class SDDS:

class SDDS:
"""This class implements SDDS datasets."""

def __init__(self, index=0):
#define common SDDS definitions
self.SDDS_VERBOSE_PrintErrors = 1
self.SDDS_EXIT_PrintErrors = 2
self.SDDS_CHECK_OKAY = 0
self.SDDS_CHECK_NONEXISTENT = 1
self.SDDS_CHECK_WRONGTYPE = 2
self.SDDS_CHECK_WRONGUNITS = 3
self.SDDS_DOUBLE = 1
self.SDDS_REAL64 = 1

I tried in PyCarm:

import sdds
from sdds import SDDS

fi = sdds.SDDS(0)
fi.load(fname)

But i got the error massages

module 'sdds' has no attribute 'SDDS'

How can i import the SDDS class and use it ?

Re: module 'sdds' has no attribute 'SDDS'

Posted: 01 Mar 2022, 10:31
by soliday
I am not a user of PyCharm, but after searching for the error message on google, looks like you will have to add the sdds.py to the PyCharm project directory.