The pwd must be a bytes object, which is written/indicated such as b'abc123'. Or more generically:
bytes('abc123', 'UTF-8') # For UTF-8 encoded string -> bytes
If you want to know more about the Data Science then do check out the following Data Science which will help you in understanding Data Science from scratch