community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Manage packages for Python Tool with CONDA in Alteryx Designer 19.3

Highlighted
Alteryx
Alteryx

Hi everyone,

 

Alteryx Designer in 2019.3 has introduced some changes to how Python environment for (not only) Python Code tool is managed.  Finally this allows us to utilize conda, which was (to my best knowledge) not possible in previous versions. Unfortunately for packages management at this time only (env not yet), but still awesome!

 

image.png 

 

For those of you who don't know Conda - Conda is an open source package management system and environment management system. Find out more at https://docs.conda.io/projects/conda/en/latest/index.html

 

Why should you care about conda?

Well, Python Code tool in Alteryx relies on pip to fetch packages when you call the Alteryx.installPackages().

 

What if that does not work for whatever reason? Maybe the package is only available at anaconda.org, or maybe you need to work with non-Python dependencies which pip simply won't install.

 

While we are at it - Pip installs Python packages whereas conda installs packages which may contain software written in any language. It does not mean that pip and conda cannot coexist, you can actually rely on both to manage your environment. Its just that the two together are stronger than either of them alone.

 

Note: Currently there is a hardcoded conda env for Python code tool and you cannot simply change this. 

It will be something like "C:\Program Files\Alteryx\bin\Miniconda3\envs\JupyterTool_vEnv"

Currently conda is limited to allow package management, not yet env management.

 

So why do I bother writing all this?

 

image.png

 

I had a problem installing Facebook's Prophet package to do some time series modelling. There were issues with pystan C++ compiler not working correctly, only CONDA INSTALL works...

 

So.... CONDA to the rescue. Take the following code snippets as just a sample of what you can achieve.

You can check out more here on packages management, or use this nice cheatsheet.

 

You should be easily able to utilize CONDA from CMD (C:\Program Files\Alteryx\bin\Miniconda3\Scripts\conda.exe) to install the package you need... (Use this reference on Conda's website for more details)

 

 

conda init cmd.exe             #You need to init the cmd.exe env, requires restart of cmd
conda info --envs              #List all your available envs

 

 image.png

 

 

conda activate JupyterTool_vEnv             #Activate the env of your choice
conda list         #This will give you list of all currently installed packages

 

 

image.png

 

conda install -c conda-forge fbprophet   #This did the trick to install package i needed

 

 

image.png

 

Just like Batman said....

 

image.png

David Matyas
Sales Engineer
Alteryx
Alteryx
Alteryx

Just in time! Great post David

Labels