title: Why is Pipenv not picking up my Pyenv versions?
body: <p>My system Python version is 3.8.5, however I use pyenv to manage an additional version, 3.6.0, to mirror the server version my project is deployed to. I previously used virtualenv + virtualenvwrapper to manage my virtual environments, but I've heard great things on pipenv and thought I would give it a go. It's all great until I try using Python 3.6.0. Flow goes something like this:</p>
  <pre class="lang-sh prettyprint-override"><code>$ mkdir test_project &amp;&amp; cd test_project
  $ pyenv shell 3.6.0
  $ pipenv install django
  Creating a virtualenv for this project…
  Pipfile: /home/user/projects/test_project/Pipfile
  Using /home/user/.pyenv/shims/python (3.6.0) to create virtualenv…
  ⠸ Creating virtual environment...created virtual environment CPython3.8.5.final.0-64 in 130ms
    creator CPython3Posix(dest=/home/user/.local/share/virtualenvs/test_project-eAvoynKo-/home/user, clear=False, global=False)
    seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/user/.local/share/virtualenv)
      added seed packages: pip==20.2.3, setuptools==50.3.0, wheel==0.35.1
    activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
  
  ✔ Successfully created virtual environment! 
  Traceback (most recent call last):
    File &quot;/home/user/.pyenv/versions/3.6.0/bin/pipenv&quot;, line 11, in &lt;module&gt;
      sys.exit(cli())
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py&quot;, line 829, in __call__
      return self.main(*args, **kwargs)
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py&quot;, line 782, in main
      rv = self.invoke(ctx)
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py&quot;, line 1259, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py&quot;, line 1066, in invoke
      return ctx.invoke(self.callback, **ctx.params)
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py&quot;, line 610, in invoke
      return callback(*args, **kwargs)
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py&quot;, line 73, in new_func
      return ctx.invoke(f, obj, *args, **kwargs)
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/core.py&quot;, line 610, in invoke
      return callback(*args, **kwargs)
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py&quot;, line 21, in new_func
      return f(get_current_context(), *args, **kwargs)
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/cli/command.py&quot;, line 252, in install
      site_packages=state.site_packages
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py&quot;, line 1928, in do_install
      site_packages=site_packages,
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py&quot;, line 580, in ensure_project
      pypi_mirror=pypi_mirror,
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py&quot;, line 512, in ensure_virtualenv
      python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
    File &quot;/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/pipenv/core.py&quot;, line 986, in do_create_virtualenv
      with open(project_file_name, &quot;w&quot;) as f:
  FileNotFoundError: [Errno 2] No such file or directory: '/home/user/.local/share/virtualenvs/test_project-eAvoynKo-/home/user/.pyenv/shims/python/.project'
  
  </code></pre>
  <p>I came across this previous question <a href="https://stackoverflow.com/questions/51201018/pipenv-not-recognizing-pyenv-version">Pipenv not recognizing Pyenv version?</a> and set the environment variable <code>PIPENV_PYTHON=&quot;$PYENV_ROOT/shims/python</code> in my <code>.bashrc</code> file. to no avail.</p>
  <p>Using the system Python version 3.8.5 works flawlessly:</p>
  <pre class="lang-sh prettyprint-override"><code>$ pyenv install django
  Creating a virtualenv for this project…
  Pipfile: /home/user/projects/test_project/Pipfile
  Using /home/user/.pyenv/shims/python (3.8.5) to create virtualenv…
  ⠹ Creating virtual environment...created virtual environment CPython3.8.5.final.0-64 in 114ms
    creator CPython3Posix(dest=/home/user/.local/share/virtualenvs/test_project-eAvoynKo-/home/user/.pyenv/shims/python, clear=False, global=False)
    seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/user/.local/share/virtualenv)
      added seed packages: pip==20.2.2, setuptools==50.3.0, wheel==0.35.1
    activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
  
  ✔ Successfully created virtual environment! 
  Virtualenv location: /home/user/.local/share/virtualenvs/test_project-eAvoynKo-/home/user/.pyenv/shims/python
  Creating a Pipfile for this project…
  Installing django…
  Adding django to Pipfile's [packages]…
  ✔ Installation Succeeded 
  Pipfile.lock not found, creating…
  Locking [dev-packages] dependencies…
  Locking [packages] dependencies…
  Building requirements...
  Resolving dependencies...
  ✔ Success! 
  Updated Pipfile.lock (a6086c)!
  Installing dependencies from Pipfile.lock (a6086c)…
       ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/0 — 00:00:00
  To activate this project's virtualenv, run pipenv shell.
  Alternatively, run a command inside the virtualenv with pipenv run.
  </code></pre>
  <h2>Update</h2>
  <p>While I still can't get it to recognize the python version activated with <code>pyenv shell x.x.x</code>, by removing the <code>PIPENV_PYTHON</code> environment variable, and creating a new virtualenv with <code>pipenv install --python 3.6</code> pipenv does recognize the pyenv version installed.</p>