ImportError

![image](https://cloud.githubusercontent.com/assets/22092607/20293383/d69fac28-ab30-11e6-955e-634e0568ea8f.png)


This looks like you have had a problem with your installation. Where did you install requests from?


I'm seeing a potentially similar error on python 3; I believe it comes from https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/contrib/appengine.py#L45

Note the double traceback, the second error is misleading:

```
Traceback (most recent call last):
  File ".tox/py35/lib/python3.5/site-packages/requests_toolbelt/_compat.py", line 49, in <module>
    from requests.packages.urllib3.contrib import appengine as gaecontrib
  File ".tox/py35/lib/python3.5/site-packages/requests/packages/urllib3/contrib/appengine.py", line 45, in <module>
    from urlparse import urljoin
ImportError: No module named 'urlparse'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".tox/py35/lib/python3.5/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File ".tox/py35/lib/python3.5/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File ".tox/py35/lib/python3.5/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File ".tox/py35/lib/python3.5/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File ".tox/py35/lib/python3.5/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File ".tox/py35/lib/python3.5/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 665, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "ttm_cli/tests/test_objects.py", line 7, in <module>
    from ttm_cli.tests.mock_ttm import MockTTM
  File "ttm_cli/tests/mock_ttm.py", line 11, in <module>
    from ttm_cli.ttm import TTM
  File "ttm_cli/ttm.py", line 11, in <module>
    from requests_toolbelt import MultipartEncoder
  File ".tox/py35/lib/python3.5/site-packages/requests_toolbelt/__init__.py", line 12, in <module>
    from .adapters import SSLAdapter, SourceAddressAdapter
  File ".tox/py35/lib/python3.5/site-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
    from .ssl import SSLAdapter
  File ".tox/py35/lib/python3.5/site-packages/requests_toolbelt/adapters/ssl.py", line 16, in <module>
    from .._compat import poolmanager
  File ".tox/py35/lib/python3.5/site-packages/requests_toolbelt/_compat.py", line 51, in <module>
    from urllib3.contrib import appengine as gaecontrib
ImportError: No module named 'urllib3'
```


I don't think that's quite the same: the traceback is different. 


Yeah it may be importing via a different route, but you see `ImportError: No module named 'urllib3'` when the issue is actually from `ImportError: No module named 'urlparse'`


@leth That's a Python 3 specific traceback format, but Python 2 doesn't show that. And in this case, we can see where the failing import is, and it doesn't attempt to import the `gaecontrib` module. So it's definitely a different issue.


@leth further, your traceback is from the requests_toolbelt, not requests itself.


Okay, fine, you can reproduce it without toolbelt installed though, but perhaps this is unsupported: `python3 -c 'import requests.packages.urllib3.contrib.appengine'`


@moyotar you seem to be using [ycmd](https://github.com/Valloric/ycmd) which uses [git submodules](https://github.com/Valloric/ycmd/tree/master/third_party) to vendory dependencies. Specifically it uses python-future, which has been known to break urllib3 because of the incredibly poor way in which it _attempts_ to provide python 2 and 3 compatibility.


@leth It's not unsupported, please update requests to 2.12.0 which resolves that problem.


@leth Sorry, that's not quite true: the issue is fixed in urllib3 master and will come through to Requests in due course. Right now urllib3's appengine support doesn't work on Python 3.


@Lukasa I installed `ycmd` which includes `requests` in windows 7. I copied it to windows 10.


@moyotar that doesn't really answer our question of what you used to install it.

Either way, this seems (at first glance) to be an issue you should bring up with the [ycmd mailing list](https://groups.google.com/forum/?hl=en#!forum/ycmd-users).


@sigmavirus24 I don't really understand what you mean. It's about my python version? If yes, it's python27.


I just installed `ycmd` by following instruction. And the one thing I did is that I moved `ycmd` from win7 to win10.


@Lukasa @sigmavirus24 Up to now, I don't kown why I got this error and have no ideas to solve it. I'd be really appreciate if you can give me some help.


We're not really able to help you. You'll have to check with the `ycmd` folks to see what's going on, but their installation appears to be broken.


I agree with @Lukasa. You've also provided us minimal information. I couldn't reproduce this if I tried because I don't know what instructions you followed and while we've asked for more detail you haven't provided it. We can't help you if you won't let us.


@sigmavirus24 Sorry.I don't understand what info you need. The error output is as the pic. I followed [ycmd's building](https://github.com/Valloric/ycmd#building) to install it.


@moyotar Moving ycmd from Win 7 to Win 10 is probably what's causing this, and that's the info we'd need. You're pretty vague about what you meant by "moving", did you reinstall, or did you copy a folder? You also mentioned Windows, and didn't actually link to ycmd's instructions for installing on Windows. You linked general build instructions that then pass you off to a different page for Windows.

If you want support for FOSS the goal should be to overflow the maintainers with information and reproducible steps for your bug. Most open source packages at this level function because the maintainers work for almost or literally free.

There's a pretty huge gulf between the stacktrace you get and what library maintainers need to actually resolve the issue, it seems like you're conflating the two.

EDIT: I didn't mean to come off so harsh, it's just that I've seen the work the Requests team puts into this library, and they will go above what's reasonably expected to help you if you give them anything to work with.


@drpoggi Thanks! Now I decide to reinstall `ycmd` to get it work.


The issue was caused by different versions of Python 2 installed on the same machine. See https://github.com/Valloric/ycmd/issues/646 for details. Nothing to do with python-future.