diff --git a/news/3287.bugfix.rst b/news/3287.bugfix.rst new file mode 100644 index 0000000000..b9e14f0dbb --- /dev/null +++ b/news/3287.bugfix.rst @@ -0,0 +1 @@ +Clear pythonfinder cache after Python install diff --git a/pipenv/core.py b/pipenv/core.py index 7f488aead6..8b856836fa 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -455,6 +455,11 @@ def abort(): sp.ok(environments.PIPENV_SPINNER_OK_TEXT.format("Success!")) # Print the results, in a beautiful blue… click.echo(crayons.blue(c.out), err=True) + # Clear the pythonfinder caches + from .vendor.pythonfinder import Finder + finder = Finder(system=False, global_search=True) + finder.find_python_version.cache_clear() + finder.find_all_python_versions.cache_clear() # Find the newly installed Python, hopefully. version = str(version) path_to_python = find_a_system_python(version)