# ExternalEvaluate of Python do not work (Anaconda)

I cannot get the ExternalEvaluate work for my Python. It says "missing dependencies" for the registration status. I have attached screenshots from Mathematica and Terminal. From the terminal screenshot you can see that I already have "pyzmq" installed. Does anyone have a solution to this?

• Use StartExternalSession and specify which exact Python executable you want to use. You have several installations and the one ExternalEvaluate would start does not have the dependencies installed. Sep 11 '19 at 7:17
• Thanks for the reply. But the problem for me is that all the Python executables are missing dependencies? Why is that, how to fix it? Sep 12 '19 at 14:18
• You must specify the path to the exact executable for which you installed the dependency. I don't see that one in the list. Sep 12 '19 at 15:59
• Try this: Activate the anaconda environment you want to use. Make sure the dependencies are installed in this environment. Run which python to get the correct path to the python executable. Use this path with StartExternalSession. See the docs (under Details) for how. Sep 12 '19 at 20:00
• It worked now! Thanks a lot. Sep 13 '19 at 21:48

The question has not yet receive a formal answer so I put one here from the comments of Szabolcs and baker.

First install pyzmq by opening a terminal window and entering

pip install pyzmq


(the process takes a few minutes). That should be it! In Mathematica, type

FindExternalEvaluators["Python"]


which should show all the Python installations available. Note that the column "Registered" should now indicate "Automatic" for those versions of Python compatible with both Mathematica and pyzmq.

From here, you can run Python code in Mathematica. /if there is a problem, you can specifically specify which version you wan to select with for example:

session = StartExternalSession[{"Python", "Version" -> "2.7.16"}]


Make sure that the version selected is registered.