Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Have different Python Module versions for different workflows

MatthewP
Alteryx
Alteryx
Created
 How To: Have Different Python Module Versions For Different Workflows
The below steps will walk through how to have two different versions of PyPDF2 (can be any module) available to be used within different workflows.
 Prerequisites
  • Alteryx  Designer 
    • All 
  • Python Tool and Command Prompt
  • NOTE: JupyterTool_vEnv folder was renamed to DesignerBaseTools_vEnv in versions 2021.1.4 and higher
 Procedure
 
  1. Install the older module you want first. (See the below two community articles on how to install Modules)  
    1. https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-To-Use-Alteryx-installPackages-...
    2. https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Install-Python-packages-via-command...
  2. Create a folder called "old_version" within one of the two below locations based on the installed version you have (these locations are assuming you installed with default C drive).
    1. C:\Users\USERNAME\AppData\Local\Alteryx\bin\Miniconda3\envs\JupyterTool_vEnv\Lib\site-packages  (For Non-admin version)
    2. C:\Program Files\Alteryx\bin\Miniconda3\envs\JupyterTool_vEnv\Lib\site-packages (Admin or Server version)
  3. Cut/Move the version of the Module that you installed (see below screenshot for an example).python1.PNG
  4. Install the newer version of the same module (see below screenshot of an example)python2.PNG
  5.  Test the import of the Module either with a command prompt (see first screenshot) or within Designer. To make sure that the versions are different note how the below examples are importing them.
    1. For the older version you have to use "from old_version import PyPDF2"
    2. For the new version you use the normal "import PyPDF2"
Command Example: You can see the version differences 
image.png

Designer Example:
Python4.PNG
 
Comments
Colgan
ACE Emeritus
ACE Emeritus

Thanks for this writeup!  Images are only showing icons, would love to see those screenshots

lepome
Alteryx Alumni (Retired)

@Colgan I can see the screenshots with Chrome Version 88, but not with Firefox Version 85, nor with Edge Version 88.  I'll mention this to the Community folks to see whether this is a trend.

Colgan
ACE Emeritus
ACE Emeritus

Interesting.  I'm using Chrome 88 too.  This and this is what I see on the page.  Can't click on it either.

Colgan_1-1614388849246.png

 

Colgan_0-1614388791217.png

 

SeanAdams
17 - Castor
17 - Castor

Hey @MatthewP - thank you for writing this up.

 

Do you know how to set this up so that it runs on the server env - we have some situations where Alteryx canvasses need to run using different versions of Python modules on the server?

MatthewP
Alteryx
Alteryx

Hello @SeanAdams,

 

I am not sure if you have received an further answers on this but you should be able to roll this out for Server just like it is in the original post. The only trick to that is that your Server Admins will just have to make sure those different versions are separate and that the workflows that need to call the older version of the module are uploaded with the correct import statements (this is on the user to do). For those users I would suggest that they replicate that folder structure locally that way they can test their workflows locally with the correct import statements before publishing to Gallery so they don't need to make any changes.

 

Please feel free to reach out to me if you have any further questions!

JeffA
Alteryx Alumni (Retired)

@SeanAdamsA new option is also available now. You could use the Jupyter Flow tool to package your jupyter environments with each tool individually. This should also run natively on Server. If you get a chance to check out the tool let me know how well it works for you!

AkiraKakinuma
5 - Atom
Hello @MatthewP, thank you for writing this!!

But I can't click the screenshot to open it either. I would like to refer to the contents of the screenshot, so it would be very helpful if you could upload it again if possible.