6
$\begingroup$

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.

$\endgroup$
  • 1
    $\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
7
$\begingroup$

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 *)

ExternalEvaluate`Private`resetCache[]

which will clear the cached data.

$\endgroup$

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.