I'm posting this in hopes that it will help someone who may have the same problem as I did.
When trying to print a class inherited from _PrintableStructure such as c_nvmlProcessInfo_t() using print(c_nvmlProcessInfo_t()), the following AttributeError occurred.
AttributeError: module 'string' has no attribute 'join'
This is because string.join() has been removed in python3.
The problem was solved by changing the value returned from __str__ of the _PrintableStructure class in pynvml.py as follows.
Thank you for providing this library.
I'm posting this in hopes that it will help someone who may have the same problem as I did. When trying to print a class inherited from
_PrintableStructure
such asc_nvmlProcessInfo_t()
usingprint(c_nvmlProcessInfo_t())
, the following AttributeError occurred.AttributeError: module 'string' has no attribute 'join'
This is because
string.join()
has been removed in python3. The problem was solved by changing the value returned from__str__
of the_PrintableStructure
class in pynvml.py as follows.Original:
return self.__class__.__name__ + "(" + string.join(result, ", ") + ")"
Modified:
return self.__class__.__name__ + "(" + ", ".join(result) + ")"