TypeError: a bytes-like object is required, not 'str' - python 2 to 3 [duplicate]
This question already has an answer here: Why do I need 'b' to encode a string with Base64? 6 answers Hi I am having trouble with this error message. I am new to Python and this Python2 and Python3 is a hassle. I'm not sure what to do here, the error message is as shown below. Using Ticker: AAPL Traceback (most recent call last): File "realtime.py", line 18, in <module> r=requests.get(auth_url, headers={"Authorization": "Basic %s" % base64.b64encode(os.environ['INTRINIO_USER'] + ":" + os.environ['INTRINIO_PASSWORD'])}) File "C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\base64.py