FindExternalEvaluators[“Python”] gives me an uninstalled version of Python

Long time ago, I have two versions of python installed in my pc, and I registered them all in mathematica. Later I uninstalled one of them, but FindExternalEvaluators["Python"] still gived me two results, and then when I wanted to run StartExternalSession["Python"],it tried to launch the uninstalled one first and gived me a lot of warning. The uninstalled Python is neither in the path of my system nor in the path of mathematica, and UnregisterExternalEvaluator doesn't work either. So how can I do if I want to get one result when I run FindExternalEvaluators["Python"]? My system is windows 10, version of mathematica is 11.2.

• You can start with a clean slate by evaluating ExternalEvaluate; ExternalEvaluatePrivateresetCache[] which will clear the cached external evaluator instances. – ilian Mar 12 '18 at 1:36
• It works. Thank you! – Jie Zhu Mar 13 '18 at 3:33

Update: As of version 12, one should use

FindExternalEvaluators["Python", "ResetCache" -> True]


To turn my comment into an answer, ExternalEvaluate keeps a cache of evaluators it has found or used previously, and sometimes it can make invalid data persist.

In such cases, it is often useful to start with a clean slate, using the following command

ExternalEvaluate; (* trigger autoloading *)

ExternalEvaluatePrivateresetCache[]


which will clear the cached data.

• This appears to no longer work in version 12.2. – david Dec 24 '20 at 20:11
• Thanks @david, I made an edit. – ilian Jan 19 at 21:37
• Yes @ilian, that did the trick. Thanks. – david Jan 19 at 22:45