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!

Changes to Python SDK environment in 2019.1?

Highlighted
Asteroid

Hi there,

 

after updating to 2019.1, I noticed that my Python SDK tool gives error messages that I haven't had before:

 

Traceback (most recent call last): File "KeywordExtraction_v2.0Engine.py", line 8, in <module> File
"C:\ProgramData\Alteryx\Tools\KeywordExtraction_v2.0\KeywordExtraction\Extractor.py", line 2, in <module> import spacy File
"C:\ProgramData\Alteryx\Tools\KeywordExtraction_v2.0\Lib\site-packages\spacy\__init__.py", line 4, in <module> from .cli.info import info as cli_info File
"C:\ProgramData\Alteryx\Tools\KeywordExtraction_v2.0\Lib\site-packages\spacy\cli\__init__.py", line 1, in <module> from .download import download File
"C:\ProgramData\Alteryx\Tools\KeywordExtraction_v2.0\Lib\site-packages\spacy\cli\download.py", line 4, in <module> import plac File
"C:\ProgramData\Alteryx\Tools\KeywordExtraction_v2.0\Lib\site-packages\plac.py", line 29, in <module> from plac_core import * File
"C:\ProgramData\Alteryx\Tools\KeywordExtraction_v2.0\Lib\site-packages\plac_core.py", line 316, in <module> def call(obj, arglist=sys.argv[1:], eager=True, version=None): AttributeError: module 'sys' has no attribute 'argv'

The error comes from the plac module which is imported by spaCy. While both are 3rd party tools, I did not have this error message in any of my Python 3.7 development environments.

 

Has the Miniconda environment changed? Have there been any modifications to the base packages?

 

Best

Christopher

 

Alteryx
Alteryx

Hi @chrisha, we did make some changes to the underlying code in 19.1 that may be causing these issues. Would it be possible for you to send over the tool you're using so that we can test it? Thanks!

Sr. Data Science Content Engineer
Sr. Data Science Content Engineer

Hi @chrisha,

 

I also ran into this error in some of my SDK tools (all the ones that use spaCy) after upgrading. To work around it, try adding 

sys.argv = []

 

to your tool's code right before you import spaCy. It's a little hacky, but it resolved the error for me. Please let me know if it works for you as well!

 

Thanks!

 

Sydney

Asteroid

@BlytheE Sure, happy to send it via email. To which address?

 

The code base for the spaCy part is from an internal library we will be using in different settings. So making changes only for Alteryx in there is not really an option (changing sys.argv within a module also seems wrong to me). I can try to include your workaround before loading our library -- but, yes, it's quite hacky and I'd prefer a more robust solution.

 

Since we rolled back the updates because of this issue on both the Server and our Designer systems, I cannot test it further right now. Will try when I've got a testing environment with 2019.1.

 

Thanks

Christopher