@Heeya8876 , both @SAMSAL and I have recently gone through the adventures of getting 2.0.0-M1 to run with the Python extension enabled. Here are some findings so far on the Linux side of things.
- Java 21 is required (any platform)
- Python 3.9+ (any platform) is required (I believe @SAMSAL, correct me if I'm wrong, said Python 3.12 did NOT work, but we both got 3.11 to run)
- If it's installed, make sure it's the default set with "sudo update-alternatives java"
- Make sure your environment has JAVA_HOME defined with the path for Java 21
- Make sure Python3.9+ is the default prior to running NiFi with "sudo update-alternatives --config python3"
- Executing python3 --version should show whichever version you set as your default and it should be 3.9~3.11
- You can see what version was copied by NiFi in the directory "./work/python/controller/bin/python3 --version"
- If this is showing anything <3.9 then delete the work folder, follow the steps above, and try again.
- If you build a processor from scratch the Developer guide says to use this for your __init__
def __init__(self, **kwargs):
super().__init__(**kwargs)
- You'll get an error...replace super().__init__(**kwargs) with pass like the examples that come with the install.
- Changes to your Python extensions are not immediate....NiFi polls the directory periodically to detect changes, download dependencies, and load the updated processors. Sometimes I had to restart NiFi to get it to detect my changes if my previous code update made it really unhappy.
- ./logs/nifi-python.log will be your friend for Python extension related issues
- If your Python extension has dependencies and it fails to download them you can see the command it attempted in nifi-python.log; I manually ran the commands in the logs and it downloaded the modules into the correct place and worked...perhaps there's a timeout for module downloads? (just a guess since the module had a ton of large dependencies)
- I don't think I saw it in the Developer's Guide but did notice while building a custom FlowFileTransform Python extension, the "content" data returned with the FlowFileTransformResult should be a string or byte array.
@SAMSAL has additional insight on getting it to start up on Windows