<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question ExecuteScript with python 3 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/ExecuteScript-with-python-3/m-p/296522#M218266</link>
    <description>&lt;P&gt;I am trying to use the ExecuteScript processor to run a python program that connects to irc and posts messages. I have python3 on my system but when I paste the python code into the ExecuteScript processor I get the following error:&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Unable to load script: TypeError: str() takes at most 1 arguments (2 given) in &amp;lt;script&amp;gt; at line number 14: javax.script.ScriptException: TypeError: str() takes at most 1 arguments (2 given) in &amp;lt;script&amp;gt; at line number 14&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;javax.script.ScriptException: AttributeError: 'NoneType' object has no attribute 'strip' in&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;that line of code looks like below:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ircsock.send(bytes("USER "+ botnick +" "+ botnick +" "+ botnick + " " + botnick + "\n", "UTF-8"))
ircmsg = ircmsg.strip('\n\r')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;in the python script I am pointing to python3&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#!/usr/local/bin/python3.7
import socket

ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can i get the ExecuteScript processor to use python3? I believe the issue is that NiFi is still using python 2.7 in /usr/bin.&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 May 2020 03:00:57 GMT</pubDate>
    <dc:creator>saner</dc:creator>
    <dc:date>2020-05-24T03:00:57Z</dc:date>
  </channel>
</rss>

