<p dir="auto">Duplicate: <a href="http://stackoverflow.com/questions/9762685/using-the-requests-python-library-in-google-app-engine" rel="nofollow">http://stackoverflow.com/questions/9762685/using-the-requests-python-library-in-google-app-engine</a></p>
<p dir="auto">Google App Engine is used by a lot of developers. I use the python environment myself. It's sandboxed and can't rely on any non-Python code. It also has other restrictions (for example, you need to use this patched version of urllib3  <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3686364" data-permission-text="Title is private" data-url="https://github.com/urllib3/urllib3/issues/61" data-hovercard-type="issue" data-hovercard-url="/urllib3/urllib3/issues/61/hovercard" href="https://github.com/urllib3/urllib3/issues/61">urllib3/urllib3#61</a>.)</p>
<p dir="auto">I can successfully</p>
<blockquote>
<blockquote>
<blockquote>
<p dir="auto">import requests</p>
</blockquote>
</blockquote>
</blockquote>
<p dir="auto">but then</p>
<blockquote>
<blockquote>
<blockquote>
<p dir="auto">response = requests.get('someurl')</p>
</blockquote>
</blockquote>
</blockquote>
<p dir="auto">fails with the following traceback. Does anyone know what's going on?</p>
<p dir="auto">Traceback (most recent call last): File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/admin/init.py", line 317, in post exec(compiled_code, globals()) File "", line 6, in File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py", line 52, in get return request('get', url, *_kwargs) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/api.py", line 40, in request return s.request(method=method, url=url, *_kwargs) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/sessions.py", line 208, in request r.send(prefetch=prefetch) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/models.py", line 458, in send self.auth = get_netrc_auth(url) File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py", line 43, in get_netrc_auth for loc in locations: File "/Users/Rohan/Dropbox/MuktiTechnologiesINC/MuktiTechnologies/GAE/humanmictweet/GAE/libraries/requests/utils.py", line 40, in locations = (os.path.expanduser('~/{0}'.format(f)) for f in NETRC_FILES) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 260, in expanduser userhome = pwd.getpwuid(os.getuid()).pw_dir AttributeError: 'module' object has no attribute 'getuid'</p>
<p dir="auto">After upgrading to 1.1.0, I now get this error when trying to pickle the Session object:</p>
<p dir="auto">File "/Library/Python/2.6/site-packages/requests/sessions.py", line 397, in <strong>getstate</strong><br>
return dict((attr, getattr(self, attr, None)) for attr in self.<strong>attrs</strong>)<br>
AttributeError: 'Session' object has no attribute '<strong>attrs</strong>'</p>