module 'sdds' has no attribute 'SDDS'

Moderators: cyao, soliday

Post Reply
Elaf_Musa
Posts: 3
Joined: 28 Feb 2022, 09:12

module 'sdds' has no attribute 'SDDS'

Post by Elaf_Musa » 01 Mar 2022, 03:35

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 ?

soliday
Posts: 405
Joined: 28 May 2008, 09:15

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

Post by soliday » 01 Mar 2022, 10:31

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.

Post Reply