I’m getting a strange error when trying to set up the Gmail API in my Python project. The error message mentions something about Module_six_moves_urllib_parse not having the urlparse attribute. I think this might be related to package version conflicts but I’m not sure how to fix it.
I already tried updating the six package using pip but that didn’t help at all. The error happens when I run my authentication script.
Here’s the full error traceback:
Traceback (most recent call last):
File "./gmail_setup.py", line 31, in <module>
auth_credentials = execute(oauth_flow, TOKEN_STORAGE, http=http_client)
File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 141, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Python/2.7/site-packages/oauth2client/old_run.py", line 124, in execute
auth_url = oauth_flow.step1_get_authorize_url()
File "/Library/Python/2.7/site-packages/oauth2client/util.py", line 141, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 1831, in step1_get_authorize_url
return _update_query_params(self.auth_uri, query_params)
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 439, in _update_query_params
parts = urllib.parse.urlparse(uri)
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'
What’s the best way to resolve this issue?