You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nifi.apache.org by Bob Paulin <bo...@bobpaulin.com> on 2024/03/13 22:09:37 UTC

Dealing with cross OS Python venv

Hi,

Recently I ran into an existing issue [1] running Nifi's python 
extensions on windows. It appears that windows uses Scripts instead of 
bin to store the python virtual environment executable binaries [2].  As 
the user mentions simply renaming the directory name to bin does not 
work.  It does seem to work when I introduce a config to allow the 
virtual environment binary directory to be specified [3]. This allows 
the directory to be updated following installation which enables the 
server to start and it allows me to run python processors that do not 
have other cross operating system incompatibilities.  This makes windows 
usage with the extensions possible so at a minimum I'd like this PR to 
be considered. I've also worked on projects that build toggles between 
operating systems using Java System properties similar to the util Nifi 
has [4].  Does Nifi have an opinion on whether this sort of OS toggling 
should be automatic or just possible by manually updating the configs.  
I'm happy to update my PR to add some automatic toggling based on OS.  
Thanks!

- Bob Paulin


[1] https://issues.apache.org/jira/browse/NIFI-12514

[2] https://docs.python.org/3/library/venv.html

[3] https://github.com/apache/nifi/pull/8500

[4] 
https://github.com/apache/nifi/blob/7db1664a7e2d473a5e30633bea547004e22487c6/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/OSUtil.java#L19