markap14 commented on code in PR #8573:
URL: https://github.com/apache/nifi/pull/8573#discussion_r1551643116
##########
nifi-nar-bundles/nifi-py4j-bundle/nifi-py4j-bridge/src/main/java/org/apache/nifi/py4j/PythonProcess.java:
##########
@@ -234,8 +240,18 @@ private Process launchPythonProcess(final int
listeningPort, final String authTo
final List<String> commands = new ArrayList<>();
commands.add(pythonCommand);
+ if (!isUseVirtualEnv()) {
+ // If not using venv, we will not launch a separate virtual
environment, so we need to use the -S
+ // flag in order to prevent the Python process from using the
installation's site-packages. This provides
+ // proper dependency isolation to the Python process.
+ commands.add("-S");
+ }
String pythonPath = pythonApiDirectory.getAbsolutePath();
+ final String absolutePath = virtualEnvHome.getAbsolutePath();
+ final File dependenciesDir = new File(new File(absolutePath),
"NAR-INF/bundled-dependencies");
Review Comment:
Good catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]