pydrive: TypeError: argument should be integer or bytes-like object, not 'str'

I get this error:

20:46 ~/projects/brawl_stars_api $ python3.8
Traceback (most recent call last):
  File "", line 13, in <module>
    file1.Upload() # Upload the file.
  File "/home/0dminnimda/.local/lib/python3.8/site-packages/pydrive/", line 285, in Upload
  File "/home/0dminnimda/.local/lib/python3.8/site-packages/pydrive/", line 61, in _decorated
  File "/home/0dminnimda/.local/lib/python3.8/site-packages/pydrive/", line 523, in Authorize
    self.service = build('drive', 'v2', http=self.http)
  File "/usr/lib/python3.8/site-packages/googleapiclient/", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/googleapiclient/", line 222, in build
    content = _retrieve_discovery_doc(
  File "/usr/lib/python3.8/site-packages/googleapiclient/", line 273, in _retrieve_discovery_doc
    resp, content = http.request(actual_url)
  File "/usr/lib/python3.8/site-packages/oauth2client/", line 173, in new_request
    resp, content = request(orig_request_method, uri, method, body,
  File "/usr/lib/python3.8/site-packages/oauth2client/", line 280, in request
    return http_callable(uri, method=method, body=body, headers=headers,
  File "/usr/lib/python3.8/site-packages/httplib2/", line 1948, in request
    (response, content) = self._request(
  File "/usr/lib/python3.8/site-packages/httplib2/", line 1621, in _request
    (response, content) = self._conn_request(
  File "/usr/lib/python3.8/site-packages/httplib2/", line 1528, in _conn_request
  File "/usr/lib/python3.8/site-packages/httplib2/", line 1309, in connect
    sock.connect((, self.port))
  File "/usr/lib/python3.8/site-packages/", line 406, in connect
  File "/usr/lib/python3.8/site-packages/", line 357, in __negotiatehttp
    while resp.find("\r\n\r\n")==-1:
TypeError: argument should be integer or bytes-like object, not 'str'

I saw a question like this on stackoverflow:

but I don’t understand what exactly to do. I would be glad to receive any links, and more detailed explanations

[edit by admin: formatting]

Sorry about that, it looks like a configuration error on our part. If you run this Bash command it should fix it:

pip3.8 install --user --force-reinstall PySocks

thanks, this solved the problem

Excellent, thanks for confirming! Still not fixed

@tnfrs Thanks for letting us know.