command pipenv --python with an argument of only two characters raises an IndexError.
For instance: pipenv --python 2..

The line 362 in seems to be the reason.

  1. Linux
  2. Python version: Python 3.5.3
  3. Pipenv version: pipenv, version 9.0.1
Expected result

I expect this output when the major version is totally wrong:

> pipenv --python 1.                                           
Warning: Python 1. was not found on your system…
You can specify specific versions of Python with:
  $ pipenv --python path/to/python

and default to the most specific version when the major version is correct:

pipenv --python 3.
Creating a virtualenv for this project…
Using /home/foo/.pyenv/versions/3.6.0/bin/python3 to create virtualenv…

Changing the line 362 to
if len(python) > 2: seems to be enough to get this behavior.

Steps to replicate
> pipenv --python 2.
Traceback (most recent call last):
  File "/home/foo/.local/lib/python3.5/site-packages/pipenv/", line 365, in find_a_system_python
    'python{0}{1}'.format(python[0], python[2]),
IndexError: string index out of range