St2 pack install fails with python 2.7.5 on Oracle Linux 7

We are trying to install packs on Oracle Linux 7 with Python 2.7.5 and StackStorm 3.1.0, but it is failing with the below error:

-bash-4.2# /vol_01/opt/stackstorm/st2/bin/virtualenv -p /opt/stackstorm/st2/bin/python --always-copy --no-download /opt/stackstorm/virtualenvs/mc_salt

Already using interpreter /opt/stackstorm/st2/bin/python
Using real prefix '/usr'
  No LICENSE.txt / LICENSE found in source
New python executable in /opt/stackstorm/virtualenvs/mc_salt/bin/python
Command /opt/stackstorm/virt...s/mc_salt/bin/python -m pip config list had error code 1
Installing setuptools, pip, wheel...

  Complete output from command /opt/stackstorm/virt...s/mc_salt/bin/python - setuptools pip wheel:
  Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/usr/lib64/python2.7/tempfile.py", line 32, in <module>
    import io as _io
  File "/usr/lib64/python2.7/io.py", line 51, in <module>
    import _io
ImportError: No module named _io

The pack installation succeeds if I install a newer Python 2 version manually and run the exact command we see in our chef cookbook with the new Python executable. Any ideas on how to proceed?

How did you install StackStorm?

We don’t offer official RPM packages for Oracle Linux so the best and safest way is to install it manually from source (Run From Sources — StackStorm 3.1.0 documentation).

Issue appears to be related to using RPM packages for a different distribution which likely ships with a different Python version than the system one (so likely the issue is using bundled python binary which is different from the system one).


You could also try playing and copying system python2 binary into /vol_01/opt/stackstorm/st2/bin and seeing if that helps, but there are many more things which are likely affecting that (also the dist-packages, C extensions, etc.) so there is no guarantee that will work.

I believe you are correct, and am glad you pointed that out. Previously we were using RHEL (a long time ago), but now we are using Oracle Linux and upgrading from OL6 to OL7.

I will give the instructions laid out in the link you gave me a shot and then get back to you here.

Sorry for the confusion, we’re using the same procedures that we used to install stackstorm on OL6 to install on OL7, with the .el7 packages and some slight differences. I believe the RPMs we are using work on OL.