Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Error with environment variables: os.environ['PATH'] - Image Template Tool

MatthewP
Alteryx
Alteryx
Created

Environment Details


  • Alteryx Designer
    • Version: 2020.2
  • Image Template Tool


Environment of the customer


The customer was getting this error (which when we see this it typically is an issue with the environment variables on the customer's environment. They could be different errors):

Error: Image Template (1):   File "", line 1
    os.environ['PATH'] = r"C:\Users\USERNAME\AppData\Local\Alteryx\bin\Miniconda3\Library\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Windows\CCM;C:\Program Files (x86)\SafeCom\SafeComPrintClient;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Pyramid 2018\R\bin\x64;C:\Program Files\Pyramid 2018\R\library\rJava\jri\x64;C:\WINDOWS\System32\OpenSSH\;";C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\;C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\Scripts\";C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\;C:\Users\USERNAME\AppData\Local\Programs\Python\Launcher\;C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps;C:\Users\USERNAME\.dotnet\tools;C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps;C:\Users\USERNAME\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\USERNAME\AppData\Local\Programs\Git\cmd;C:\Users\USERNAME\AppData\Roaming\npm;C:\Users\USERNAME\AppData\Local\Alteryx\bin;C:\Users\USERNAME\AppData\Local\Alteryx\bin\plugins\;C:\Users\USERNAME\AppData\Local\Alteryx\bin\Miniconda3\envs\TextMiningTools_venv\Lib\site-packages\pypiwin32_system32"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
SyntaxError: unexpected character after line continuation character

​​​​​​​



Cause


The customer was getting this error (which when we see this it typically is an issue with the environment variables on the customer's environment. They could be different errors):
Error: Image Template (1):   File "", line 1
    os.environ['PATH'] = r"C:\Users\USERNAME\AppData\Local\Alteryx\bin\Miniconda3\Library\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Windows\CCM;C:\Program Files (x86)\SafeCom\SafeComPrintClient;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Pyramid 2018\R\bin\x64;C:\Program Files\Pyramid 2018\R\library\rJava\jri\x64;C:\WINDOWS\System32\OpenSSH\;";C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\;C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\Scripts\";C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\USERNAME\AppData\Local\Programs\Python\Python38-32\;C:\Users\USERNAME\AppData\Local\Programs\Python\Launcher\;C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps;C:\Users\USERNAME\.dotnet\tools;C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps;C:\Users\USERNAME\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\USERNAME\AppData\Local\Programs\Git\cmd;C:\Users\USERNAME\AppData\Roaming\npm;C:\Users\USERNAME\AppData\Local\Alteryx\bin;C:\Users\USERNAME\AppData\Local\Alteryx\bin\plugins\;C:\Users\USERNAME\AppData\Local\Alteryx\bin\Miniconda3\envs\TextMiningTools_venv\Lib\site-packages\pypiwin32_system32"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     ^
SyntaxError: unexpected character after line continuation character

 In this case you see the "File """  and then at the bottom you see the "SyntaxError: unexpected character after line continuation character", which means that there is a non-string character after a "\". So the fact that you see that the error is behind a "\" character and you are looking for a non string character based on the "File "" message. You are able to find it near the python paths you see a quote after a backslash character and before the semicolon. This is what is causing the issue. 






Resolution



Once the SyntaxError was found (which in this case pointed to the python variables) I had the client provide a screenshot of his variables and as you can see below his python variables are a touch on the odd side. 



The solution was to have the two different python variables on different lines. Having them back to back like that was causing an extra quote to be created that was inside of the python path causing a " \" " which a quote is not a string character and that is the reason that there was an error. Making them different line items will reduce the extra quote after the backslash. 

Once the customer put the variables on different lines it solved the issue and they were able to use the tool without error.