I want to use specific python libraries via the Mathematica frontend. This is possible as follows
In[30]:= ExternalEvaluate["Python", "from sympy import isprime; isprime(7)"]
Out[30]= True
However, if I directly try to evaluate the same using > at the beginning of a line to use an external code cell, this does not work. For instance,
> from sympy import isprime; isprime(7)
gives as output,
Failure[[WarningSign] Message: No module named 'sympy' Tag: PythonError ]
Any ideas on how to make this work from external code cells.
import sys; sys.pathin both ExternalEvaluate and the code cell and see if there's a difference. $\endgroup$