Anaconda is one of the most used Python distributions for Data Science, as it makes it very easy to install pre-tested libraries along with their dependencies. Anaconda allows the user to organize the installed libraries in virtual environments to prevent said dependencies from interfering with each other. This script allows a JMP user to take advantage of this feature in order to keep its Python dependencies separated and well organized.
The attached Anaconda.jsl script allows a user to specify an Anaconda environment to execute Python code that depends on the specific dependency versions installed in that environment. It does so by providing a wrapper around the Python Init() command that identifies the required arguments that will make it match the given Anaconda environment. For example:
conda = Include("anaconda.jsl");
If(!conda:init(1), // debug mode
Show(Get Current Directory());
Throw("Conda initialization failed."));
// change as appropriate; use a Python 3.6 Conda environment name. // 3.7 supported but must be specified my_env = "py3";
Throw("Bad Conda environment, please use another one."));
conda:launch_env(my_env, 1); // debug mode
import numpy as np
v = np.array([[1, 2], [3, 4]])
d = int(np.linalg.det(v))
dNum = Python Get(d);
The attached .zip file includes other examples, including one that uses the Python libraries requests and beautifulSoup4 to web scrape data for analysis in JMP.
For more details on creating and re-using Anaconda virtual environments, see: