Repository: pypa/pipenv

Issue:
Traceback on dependency resolution error with editable git 
When I have an editable git repository and another requirement that causes a dependency resolution failure in my Pipfile, I get a `FileNotFoundError: [Errno 2] No such file or directory: '"/usr/bin/python3"': '"/usr/bin/python3"'` error.

My reproducer uses https://github.com/OddBloke/sphinx-git and python-novaclient==2.26.0 (which always causes a dependency resolution error, as mentioned in #1232).

(As far as I can tell, the git repository and the other requirement don't need to be at all related to end up with this traceback.)

##### Describe your environment

1. OS Type: Ubuntu 17.10
1. Python version: Python 3.6.3
1. Pipenv version: pipenv, version 9.0.1

##### Expected result

Dependency resolution error output, with no traceback.

##### Actual result

A traceback:

```pytb
Traceback (most recent call last):
  File "/home/daniel/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1865, in install
    do_init(dev=dev, allow_global=system, ignore_pipfile=ignore_pipfile, system=system, skip_lock=skip_lock, verbose=verbose, concurrent=concurrent, deploy=deploy, pre=pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1311, in do_init
    do_lock(system=system, pre=pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1102, in do_lock
    pre=pre
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/utils.py", line 557, in resolve_deps
    resolved_tree = actually_resolve_reps(deps, index_lookup, markers_lookup, project, sources, verbose, clear, pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/utils.py", line 507, in actually_resolve_reps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 200, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 274, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 153, in get_dependencies
    result = reqset._prepare_file(self.finder, ireq)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_set.py", line 523, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_install.py", line 438, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/utils/__init__.py", line 667, in call_subprocess
    cwd=cwd, env=env)
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '"/usr/bin/python3"': '"/usr/bin/python3"'
```

##### Steps to replicate

1. Put this in a Pipfile:
```
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]

sphinx-git = {git = "https://github.com/OddBloke/sphinx-git.git", editable = true}
python-novaclient = "~=2.26.0"

[dev-packages]
```
2. Run `pipenv install`.

```
$ pipenv install --verbose
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches pbr!=2.1.0,<2.0,>=0.11,>=2.0.0
Tried: 0.5.2.5.g5b3e942, 0.5.0, 0.5.1, 0.5.2, 0.5.4, 0.5.5, 0.5.6, 0.5.7, 0.5.8, 0.5.10, 0.5.11, 0.5.12, 0.5.13, 0.5.14, 0.5.15, 0.5.16, 0.5.17, 0.5.18, 0.5.19, 0.5.20, 0.5.21, 0.5.22, 0.5.23, 0.6, 0.7.0, 0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.9.0, 0.10.0, 0.10.0, 0.10.1, 0.10.1, 0.10.2, 0.10.2, 0.10.3, 0.10.3, 0.10.4, 0.10.4, 0.10.5, 0.10.5, 0.10.6, 0.10.6, 0.10.7, 0.10.7, 0.10.8, 0.10.8, 0.11.0, 0.11.0, 0.11.1, 0.11.1, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.1.0, 1.1.0, 1.1.1, 1.1.1, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.4.0, 1.4.0, 1.5.0, 1.5.0, 1.6.0, 1.6.0, 1.7.0, 1.7.0, 1.8.0, 1.8.0, 1.8.1, 1.8.1, 1.9.0, 1.9.0, 1.9.1, 1.9.1, 1.10.0, 1.10.0, 2.0.0, 2.0.0, 2.1.0, 2.1.0, 3.0.0, 3.0.0, 3.0.1, 3.0.1, 3.1.0, 3.1.0, 3.1.1, 3.1.1
CRITICAL:pip.utils:Error [Errno 2] No such file or directory: '"/usr/bin/python3"': '"/usr/bin/python3"' while executing command python setup.py egg_info
Traceback (most recent call last):
  File "/home/daniel/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1865, in install
    do_init(dev=dev, allow_global=system, ignore_pipfile=ignore_pipfile, system=system, skip_lock=skip_lock, verbose=verbose, concurrent=concurrent, deploy=deploy, pre=pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1311, in do_init
    do_lock(system=system, pre=pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1102, in do_lock
    pre=pre
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/utils.py", line 557, in resolve_deps
    resolved_tree = actually_resolve_reps(deps, index_lookup, markers_lookup, project, sources, verbose, clear, pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/utils.py", line 507, in actually_resolve_reps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 200, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 274, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 153, in get_dependencies
    result = reqset._prepare_file(self.finder, ireq)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_set.py", line 523, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_install.py", line 438, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/utils/__init__.py", line 667, in call_subprocess
    cwd=cwd, env=env)
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '"/usr/bin/python3"': '"/usr/bin/python3"'
```


Discussion:
@OddBloke can you provide the output of `pipenv lock --clear --verbose`?
@techalchemy 

```
$ pipenv lock --clear --verbose
Locking [dev-packages] dependencies…
Using pip: -i https://pypi.python.org/simple

                          ROUND 1                           
Current constraints:

Finding the best candidates:

Finding secondary dependencies:
------------------------------------------------------------
Result of round 1: stable, done
Locking [packages] dependencies…
Using pip: -i https://pypi.python.org/simple

                          ROUND 1                           
Current constraints:
  python-novaclient~=2.26.0
  sphinx-git from git+https://github.com/OddBloke/sphinx-git.git#egg=sphinx-git

Finding the best candidates:
  found candidate python-novaclient==2.26.0 (constraint was ~=2.26.0)
  found candidate -e git+https://github.com/OddBloke/sphinx-git.git#egg=sphinx-git (constraint was <any>)

Finding secondary dependencies:
  python-novaclient==2.26.0 not in cache, need to check index
  python-novaclient==2.26.0 requires argparse, Babel>=1.3, iso8601>=0.1.9, oslo.i18n>=1.5.0, oslo.serialization>=1.4.0, oslo.utils>=1.4.0, pbr<2.0,>=0.11, PrettyTable<0.8,>=0.7, python-keystoneclient>=1.3.0, requests>=2.5.2, simplejson>=2.2.0, six>=1.9.0

New dependencies found in this round:
  adding ['argparse', '', '[]']
  adding ['babel', '>=1.3', '[]']
  adding ['gitpython', '>=0.3.6', '[]']
  adding ['iso8601', '>=0.1.9', '[]']
  adding ['oslo.i18n', '>=1.5.0', '[]']
  adding ['oslo.serialization', '>=1.4.0', '[]']
  adding ['oslo.utils', '>=1.4.0', '[]']
  adding ['pbr', '<2.0,>=0.11', '[]']
  adding ['prettytable', '<0.8,>=0.7', '[]']
  adding ['python-keystoneclient', '>=1.3.0', '[]']
  adding ['requests', '>=2.5.2', '[]']
  adding ['simplejson', '>=2.2.0', '[]']
  adding ['six', '>=1.9.0', '[]']
  adding ['sphinx', '', '[]']
Removed dependencies in this round:
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 1: not stable

                          ROUND 2                           
Current constraints:
  argparse
  Babel>=1.3
  GitPython>=0.3.6
  iso8601>=0.1.9
  oslo.i18n>=1.5.0
  oslo.serialization>=1.4.0
  oslo.utils>=1.4.0
  pbr<2.0,>=0.11
  PrettyTable<0.8,>=0.7
  python-keystoneclient>=1.3.0
  python-novaclient~=2.26.0
  requests>=2.5.2
  simplejson>=2.2.0
  six>=1.9.0
  sphinx
  sphinx-git from git+https://github.com/OddBloke/sphinx-git.git#egg=sphinx-git

Finding the best candidates:
  found candidate argparse==1.4.0 (constraint was <any>)
  found candidate babel==2.5.1 (constraint was >=1.3)
  found candidate gitpython==2.1.8 (constraint was >=0.3.6)
  found candidate iso8601==0.1.12 (constraint was >=0.1.9)
  found candidate oslo.i18n==3.19.0 (constraint was >=1.5.0)
  found candidate oslo.serialization==2.22.0 (constraint was >=1.4.0)
  found candidate oslo.utils==3.33.0 (constraint was >=1.4.0)
  found candidate pbr==1.10.0 (constraint was >=0.11,<2.0)
  found candidate prettytable==0.7.2 (constraint was >=0.7,<0.8)
  found candidate python-keystoneclient==3.14.0 (constraint was >=1.3.0)
  found candidate python-novaclient==2.26.0 (constraint was ~=2.26.0)
  found candidate requests==2.18.4 (constraint was >=2.5.2)
  found candidate simplejson==3.13.2 (constraint was >=2.2.0)
  found candidate six==1.11.0 (constraint was >=1.9.0)
  found candidate sphinx==1.6.5 (constraint was <any>)
  found candidate -e git+https://github.com/OddBloke/sphinx-git.git#egg=sphinx-git (constraint was <any>)

Finding secondary dependencies:
  python-novaclient==2.26.0 requires argparse, Babel>=1.3, iso8601>=0.1.9, oslo.i18n>=1.5.0, oslo.serialization>=1.4.0, oslo.utils>=1.4.0, pbr<2.0,>=0.11, PrettyTable<0.8,>=0.7, python-keystoneclient>=1.3.0, requests>=2.5.2, simplejson>=2.2.0, six>=1.9.0
  gitpython==2.1.8 not in cache, need to check index
  gitpython==2.1.8          requires gitdb2>=2.0.0
  oslo.i18n==3.19.0 not in cache, need to check index
  oslo.i18n==3.19.0         requires Babel!=2.4.0,>=2.3.4, pbr!=2.1.0,>=2.0.0, six>=1.10.0
  oslo.utils==3.33.0 not in cache, need to check index
  oslo.utils==3.33.0        requires debtcollector>=1.2.0, iso8601>=0.1.11, monotonic>=0.6, netaddr>=0.7.18, netifaces>=0.10.4, oslo.i18n>=3.15.3, pbr!=2.1.0,>=2.0.0, pyparsing>=2.1.0, pytz>=2013.6, six>=1.10.0
  pbr==1.10.0 not in cache, need to check index
  pbr==1.10.0               requires -
  python-keystoneclient==3.14.0 not in cache, need to check index
  python-keystoneclient==3.14.0 requires debtcollector>=1.2.0, keystoneauth1>=3.3.0, oslo.config>=5.1.0, oslo.i18n>=3.15.3, oslo.serialization!=2.19.1,>=2.18.0, oslo.utils>=3.31.0, pbr!=2.1.0,>=2.0.0, requests>=2.14.2, six>=1.10.0, stevedore>=1.20.0
  sphinx==1.6.5 not in cache, need to check index
  sphinx==1.6.5             requires alabaster<0.8,>=0.7, babel!=2.0,>=1.3, docutils>=0.11, imagesize, Jinja2>=2.3, Pygments>=2.0, requests>=2.0.0, setuptools, six>=1.5, snowballstemmer>=1.1, sphinxcontrib-websupport
  six==1.11.0 not in cache, need to check index
  six==1.11.0               requires -
  prettytable==0.7.2 not in cache, need to check index
  prettytable==0.7.2        requires -
  requests==2.18.4 not in cache, need to check index
  requests==2.18.4          requires certifi>=2017.4.17, chardet<3.1.0,>=3.0.2, idna<2.7,>=2.5, urllib3<1.23,>=1.21.1
  oslo.serialization==2.22.0 not in cache, need to check index
  oslo.serialization==2.22.0 requires msgpack-python>=0.4.0, oslo.utils>=3.31.0, pbr!=2.1.0,>=2.0.0, pytz>=2013.6, six>=1.10.0
  iso8601==0.1.12 not in cache, need to check index
  iso8601==0.1.12           requires -
  argparse==1.4.0 not in cache, need to check index
  argparse==1.4.0           requires -
  babel==2.5.1 not in cache, need to check index
  babel==2.5.1              requires pytz>=0a
  simplejson==3.13.2 not in cache, need to check index
  simplejson==3.13.2        requires -

New dependencies found in this round:
  adding ['alabaster', '<0.8,>=0.7', '[]']
  adding ['babel', '!=2.0,!=2.4.0,>=1.3,>=2.3.4', '[]']
  adding ['certifi', '>=2017.4.17', '[]']
  adding ['chardet', '<3.1.0,>=3.0.2', '[]']
  adding ['debtcollector', '>=1.2.0', '[]']
  adding ['docutils', '>=0.11', '[]']
  adding ['gitdb2', '>=2.0.0', '[]']
  adding ['idna', '<2.7,>=2.5', '[]']
  adding ['imagesize', '', '[]']
  adding ['iso8601', '>=0.1.11,>=0.1.9', '[]']
  adding ['jinja2', '>=2.3', '[]']
  adding ['keystoneauth1', '>=3.3.0', '[]']
  adding ['monotonic', '>=0.6', '[]']
  adding ['msgpack-python', '>=0.4.0', '[]']
  adding ['netaddr', '>=0.7.18', '[]']
  adding ['netifaces', '>=0.10.4', '[]']
  adding ['oslo.config', '>=5.1.0', '[]']
  adding ['oslo.i18n', '>=1.5.0,>=3.15.3', '[]']
  adding ['oslo.serialization', '!=2.19.1,>=1.4.0,>=2.18.0', '[]']
  adding ['oslo.utils', '>=1.4.0,>=3.31.0', '[]']
  adding ['pbr', '!=2.1.0,<2.0,>=0.11,>=2.0.0', '[]']
  adding ['pygments', '>=2.0', '[]']
  adding ['pyparsing', '>=2.1.0', '[]']
  adding ['pytz', '>=0a,>=2013.6', '[]']
  adding ['requests', '>=2.0.0,>=2.14.2,>=2.5.2', '[]']
  adding ['six', '>=1.10.0,>=1.5,>=1.9.0', '[]']
  adding ['snowballstemmer', '>=1.1', '[]']
  adding ['sphinxcontrib-websupport', '', '[]']
  adding ['stevedore', '>=1.20.0', '[]']
  adding ['urllib3', '<1.23,>=1.21.1', '[]']
Removed dependencies in this round:
  removing ['babel', '>=1.3', '[]']
  removing ['iso8601', '>=0.1.9', '[]']
  removing ['oslo.i18n', '>=1.5.0', '[]']
  removing ['oslo.serialization', '>=1.4.0', '[]']
  removing ['oslo.utils', '>=1.4.0', '[]']
  removing ['pbr', '<2.0,>=0.11', '[]']
  removing ['requests', '>=2.5.2', '[]']
  removing ['six', '>=1.9.0', '[]']
Unsafe dependencies in this round:
------------------------------------------------------------
Result of round 2: not stable

                          ROUND 3                           
Current constraints:
  alabaster<0.8,>=0.7
  argparse
  Babel!=2.0,!=2.4.0,>=1.3,>=2.3.4
  certifi>=2017.4.17
  chardet<3.1.0,>=3.0.2
  debtcollector>=1.2.0
  docutils>=0.11
  gitdb2>=2.0.0
  GitPython>=0.3.6
  idna<2.7,>=2.5
  imagesize
  iso8601>=0.1.11,>=0.1.9
  Jinja2>=2.3
  keystoneauth1>=3.3.0
  monotonic>=0.6
  msgpack-python>=0.4.0
  netaddr>=0.7.18
  netifaces>=0.10.4
  oslo.config>=5.1.0
  oslo.i18n>=1.5.0,>=3.15.3
  oslo.serialization!=2.19.1,>=1.4.0,>=2.18.0
  oslo.utils>=1.4.0,>=3.31.0
  pbr!=2.1.0,<2.0,>=0.11,>=2.0.0
  PrettyTable<0.8,>=0.7
  Pygments>=2.0
  pyparsing>=2.1.0
  python-keystoneclient>=1.3.0
  python-novaclient~=2.26.0
  pytz>=0a,>=2013.6
  requests>=2.0.0,>=2.14.2,>=2.5.2
  simplejson>=2.2.0
  six>=1.10.0,>=1.5,>=1.9.0
  snowballstemmer>=1.1
  sphinx
  sphinx-git from git+https://github.com/OddBloke/sphinx-git.git#egg=sphinx-git
  sphinxcontrib-websupport
  stevedore>=1.20.0
  urllib3<1.23,>=1.21.1

Finding the best candidates:
  found candidate alabaster==0.7.10 (constraint was >=0.7,<0.8)
  found candidate argparse==1.4.0 (constraint was <any>)
  found candidate babel==2.5.1 (constraint was >=1.3,!=2.0,>=2.3.4,!=2.4.0)
  found candidate certifi==2017.11.5 (constraint was >=2017.4.17)
  found candidate chardet==3.0.4 (constraint was >=3.0.2,<3.1.0)
  found candidate debtcollector==1.19.0 (constraint was >=1.2.0)
  found candidate docutils==0.14 (constraint was >=0.11)
  found candidate gitdb2==2.0.3 (constraint was >=2.0.0)
  found candidate gitpython==2.1.8 (constraint was >=0.3.6)
  found candidate idna==2.6 (constraint was >=2.5,<2.7)
  found candidate imagesize==0.7.1 (constraint was <any>)
  found candidate iso8601==0.1.12 (constraint was >=0.1.11,>=0.1.9)
  found candidate jinja2==2.10 (constraint was >=2.3)
  found candidate keystoneauth1==3.3.0 (constraint was >=3.3.0)
  found candidate monotonic==1.4 (constraint was >=0.6)
  found candidate msgpack-python==0.4.8 (constraint was >=0.4.0)
  found candidate netaddr==0.7.19 (constraint was >=0.7.18)
  found candidate netifaces==0.10.6 (constraint was >=0.10.4)
  found candidate oslo.config==5.1.0 (constraint was >=5.1.0)
  found candidate oslo.i18n==3.19.0 (constraint was >=1.5.0,>=3.15.3)
  found candidate oslo.serialization==2.22.0 (constraint was >=1.4.0,>=2.18.0,!=2.19.1)
  found candidate oslo.utils==3.33.0 (constraint was >=1.4.0,>=3.31.0)
Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
Could not find a version that matches pbr!=2.1.0,<2.0,>=0.11,>=2.0.0
Tried: 0.5.2.5.g5b3e942, 0.5.0, 0.5.1, 0.5.2, 0.5.4, 0.5.5, 0.5.6, 0.5.7, 0.5.8, 0.5.10, 0.5.11, 0.5.12, 0.5.13, 0.5.14, 0.5.15, 0.5.16, 0.5.17, 0.5.18, 0.5.19, 0.5.20, 0.5.21, 0.5.22, 0.5.23, 0.6, 0.7.0, 0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.9.0, 0.10.0, 0.10.0, 0.10.1, 0.10.1, 0.10.2, 0.10.2, 0.10.3, 0.10.3, 0.10.4, 0.10.4, 0.10.5, 0.10.5, 0.10.6, 0.10.6, 0.10.7, 0.10.7, 0.10.8, 0.10.8, 0.11.0, 0.11.0, 0.11.1, 0.11.1, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.1.0, 1.1.0, 1.1.1, 1.1.1, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.4.0, 1.4.0, 1.5.0, 1.5.0, 1.6.0, 1.6.0, 1.7.0, 1.7.0, 1.8.0, 1.8.0, 1.8.1, 1.8.1, 1.9.0, 1.9.0, 1.9.1, 1.9.1, 1.10.0, 1.10.0, 2.0.0, 2.0.0, 2.1.0, 2.1.0, 3.0.0, 3.0.0, 3.0.1, 3.0.1, 3.1.0, 3.1.0, 3.1.1, 3.1.1
Using pip: -i https://pypi.python.org/simple

                          ROUND 1                           
Current constraints:
  python-novaclient~=2.26.0
  sphinx-git from git+https://github.com/OddBloke/sphinx-git.git#egg=sphinx-git

Finding the best candidates:
  found candidate python-novaclient==2.26.0 (constraint was ~=2.26.0)
  found candidate -e git+https://github.com/OddBloke/sphinx-git.git#egg=sphinx-git (constraint was <any>)

Finding secondary dependencies:
  python-novaclient==2.26.0 requires argparse, Babel>=1.3, iso8601>=0.1.9, oslo.i18n>=1.5.0, oslo.serialization>=1.4.0, oslo.utils>=1.4.0, pbr<2.0,>=0.11, PrettyTable<0.8,>=0.7, python-keystoneclient>=1.3.0, requests>=2.5.2, simplejson>=2.2.0, six>=1.9.0
CRITICAL:pip.utils:Error [Errno 2] No such file or directory: '"/usr/bin/python3"': '"/usr/bin/python3"' while executing command python setup.py egg_info
Traceback (most recent call last):
  File "/home/daniel/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 2060, in lock
    do_lock(verbose=verbose, clear=clear, pre=pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/cli.py", line 1102, in do_lock
    pre=pre
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/utils.py", line 557, in resolve_deps
    resolved_tree = actually_resolve_reps(deps, index_lookup, markers_lookup, project, sources, verbose, clear, pre)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/utils.py", line 507, in actually_resolve_reps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 200, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 274, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 153, in get_dependencies
    result = reqset._prepare_file(self.finder, ireq)
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_set.py", line 523, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/req/req_install.py", line 438, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/daniel/.local/lib/python3.6/site-packages/pipenv/patched/pip/utils/__init__.py", line 667, in call_subprocess
    cwd=cwd, env=env)
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '"/usr/bin/python3"': '"/usr/bin/python3"'
```
OK, I think I've found the root of the issue; https://github.com/pypa/pipenv/blob/master/pipenv/utils.py#L538 calls `shellquote` on `sys.executable`, which wraps it in quotes.

This then gets passed to HackedPythonVersion, which is how it ends up being used further down the stack.
I've just confirmed locally that removing the shellquote'ing gets rid of the traceback.
@OddBloke that is incredibly helpful, thanks for the detailed debugging!  If you'd like to submit a PR to fix feel free, interestingly I think your `--verbose` output just helped me find the source of another bug!
Yep, I'll take a look at submitting a PR.

Resolving patch:
diff --git a/pipenv/utils.py b/pipenv/utils.py
--- a/pipenv/utils.py
+++ b/pipenv/utils.py
@@ -516,7 +516,7 @@ class PipCommand(pip.basecommand.Command):
             ),
             err=True)
 
-        click.echo(crayons.blue(e))
+        click.echo(crayons.blue(str(e)))
 
         if 'no version found at all' in str(e):
             click.echo(crayons.blue('Please check your version specifier and version number. See PEP440 for more information.'))
@@ -535,7 +535,7 @@ def resolve_deps(deps, which, which_pip, project, sources=None, verbose=False, p
     markers_lookup = {}
 
     python_path = which('python', allow_global=allow_global)
-    backup_python_path = shellquote(sys.executable)
+    backup_python_path = sys.executable
 
     results = []
 


Test patch:
diff --git a/tests/test_pipenv.py b/tests/test_pipenv.py
--- a/tests/test_pipenv.py
+++ b/tests/test_pipenv.py
@@ -440,6 +440,30 @@ def test_windows_pinned_pipfile(self):
             assert 'tablib' in p.lockfile['default']
 
 
+    @pytest.mark.e
+    @pytest.mark.install
+    @pytest.mark.vcs
+    @pytest.mark.resolver
+    def test_editable_vcs_install_in_pipfile_with_dependency_resolution_doesnt_traceback(self):
+        # See https://github.com/pypa/pipenv/issues/1240
+        with PipenvInstance() as p:
+            with open(p.pipfile_path, 'w') as f:
+                contents = """
+[packages]
+pypa-docs-theme = {git = "https://github.com/pypa/pypa-docs-theme", editable = true}
+
+# This version of requests depends on idna<2.6, forcing dependency resolution
+# failure
+requests = "==2.16.0"
+idna = "==2.6.0"
+                """.strip()
+                f.write(contents)
+            c = p.pipenv('install')
+            assert c.return_code == 1
+            assert "Your dependencies could not be resolved" in c.err
+            assert 'Traceback' not in c.err
+
+
     @pytest.mark.run
     @pytest.mark.install
     def test_multiprocess_bug_and_install(self):