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

Dev Space

Customize & extend the power of Alteryx. SDKs, APIs, custom tools, and more!
#SANTALYTICS

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More

Snakeplane Python Tools: error when used in saved .yxmd workflow

Alteryx Certified Partner

Hi,

 

I have been experiencing the same issue with all of my Snakeplane Python Tools, hopefully someone can help me out.

 

When I drag the tool into an open workflow it runs perfectly. It also runs when I save it inside a macro. But if I save a workflow as .yxmd, any python tools will show this error :

 

"Traceback (most recent call last):¶  File "ToolEngine.py", line 24, in <module>¶ModuleNotFoundError: No module named 'snakeplane.plugin_factory'"

 

Where 'ToolEngine.Py' is the name of the tool's python file., and line 24 is  Do I need to include snakeplane in my pycharm environment, or in requirements.txt perhaps? 

 

Any help would be really appreciated.

 

Thanks,

Mark

 

Fireball

Hi @mark_oshea 

 

Looks like line 24 got lost, was it like this?

 

from snakeplane.plugin_factory import PluginFactory

 

I'll admit I'm not sure why it 'works' in two cases, but not after saving the YXMD. You might need 'pro' support ... but I'll share.

 

You do need snakeplane in PyCharm, at least that's the IDE that I followed the example of and have been using myself. 'snakeplane' is not a requirement that you would place in the requirements.txt, but the 'inv build' (also 'invoke build') process does copy the snakeplane directory into the packages folder, and the 'ink package' process will copy it into the YXI file.

 

So have you run the 'invoke build' process from PyCharm?

 

My sample tool looks like this in PyCharm after 'inv build':

PyCharm.png

 

In the Tools folder after 'inv build':

Tools.png

 

And in the YXI file after 'inv package':

YXI.png

 

 

If you see the same in your system, I'd say we need one of the devs to review your YXI and maybe the workflow. Could there be a workflow setting that is preventing access to the file? Also, perhaps include your Designer version. I've been using 2019.1 and just this week 2019.2.

 

Best regards,

 

Cameron

Alteryx Certified Partner

Hi Cameron,

 

Thanks for the great reply!

 

Yes line 24 was 

from snakeplane.plugin_factory import PluginFactory

 

I think we were following the same Snakeplane example, as I did all of the steps you mentioned, and my final package folder looks like this:

snakeplaneimage.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I made a test tool which simply takes in input, and then outputs it. Unfortunately I am still getting the error. It runs perfectly in an unsaved workflow or in a macro, but if I save it as a .yxmd file it breaks.

 

I am running 19.1. 

 

I will try update to 19.2, and I will try the whole thing from scratch in a new environment. Hopefully it will help.


Thanks!

Highlighted
Alteryx Certified Partner

It seems now that when the workflow is saved into a folder that contains the tool's .yxi, it works. When the workflow is saved somewhere that does not contain the tool's .yxi, I get the error.

Alteryx
Alteryx

Hi @mark_oshea - can we see your yxi? If we can install it and recreate this, we can try to figure out what's going on. 

Alteryx
Alteryx

@mark_oshea 

 

Were you able to resolve this?  The location of the tool's YXI shouldn't be impacting this, and I would like to get a hold of your tool's code to see if I can reproduce the issue.  

 

Additionally, 19.1 release has issues with Python SDK tools, although this isn't one I've heard of to date.  

 

Thanks,

 

JP Kabler

JP Kabler
Software Engineer, Emerging Capabilities
Alteryx
Alteryx Certified Partner

Hi JP,

 

I didn't manage to completely resolve it, but it did turn out to only affect me. So @BlytheE and I are pretty confident it is something wrong with my own installation of Designer. I will re-install everything and see if that helps.

 

The good news is that it works for the people I am making the tools for, so its no longer really an issue.

 

Thanks.