Using Python27 as the default Python, maybe

Latest response

I hope this makes sense

I'm currently setting up a system using a software package called Cortex.

It uses a number of plugins that it calls Analyzers that run in either Python 2 or Python3.

I installed python27 and rh-python36 from SCL and installed the dependencies fine.

When cortex runs the analysers it fails because it can't find the required module. from python, I suspect it's because it's not running the right version of Python.

I'm curious about if there is away where I can configure the Cortex application (runs under it's own user) to use the correct version of python.


Invalid output
Traceback (most recent call last):
  File "VirusTotal/", line 8, in <module>
    from cortexutils.analyzer import Analyzer
ImportError: No module named cortexutils.analyzer
  "errorMessage": "Invalid output\nTraceback (most recent call last):\n  File \"VirusTotal/\", line 8, in <module>\n    from cortexutils.analyzer import Analyzer\nImportError: No module named cortexutils.analyzer\n",
  "input": null,
  "success": false


Based on the 2.7 Python, I'm guessing you're using RHEL 7.

I'm not an expert - apologies - but I'm guessing the app can't find Python in the normal path location. You might find an answer here:

Also, you need to ensure RHSCLs persist after reboot:

(OR someone will trump me with a better suggestion.)

Thanks for your response. I think this is the section that will probably work in my use case.

What I can't seem to figure out is how to enable multiple software collections, I guess I'll try a few things and see if it works.

Hi Jeremy, I have the same issue with RH y Cortex, did you solve the problem?

It hopefully gets you closer.

There's this section too:

Hi Ricardo, I did actually get it resolved. I edited the following file "/etc/systemd/system/cortex.service" and under the option "ExecStart=" I modified the command to look like the following

ExecStart=/bin/scl enable rh-python36 python27 '/opt/cortex/bin/cortex -Dconfig.file=/etc/cortex/application.conf -Dlogger.file=/etc/cortex/logback.xml -Dpidfile.path=/dev/null'

And that allows both the Python2 and Python3 Cortex analyzers to run. Hope that helps.

Thanks Jeremy, I changed the configuration and analyzers run without problems.