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.

  • 3
    $\begingroup$ You can start with a clean slate by evaluating ExternalEvaluate; ExternalEvaluate`Private`resetCache[] which will clear the cached external evaluator instances. $\endgroup$ – ilian Mar 12 '18 at 1:36
  • $\begingroup$ It works. Thank you! $\endgroup$ – 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 *)


which will clear the cached data.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.