puppet-python icon indicating copy to clipboard operation
puppet-python copied to clipboard

Issues with CentOS7 and python3

Open jameskirsop opened this issue 7 years ago • 5 comments
trafficstars

This is a new issue to replace the prematurely closed #303 (as requested by @bastelfreak).

The core of this issue is that a number of combinations of configuration get python/virtualenv/pip3 partially installed, but not one single combination seems to get everything installed.

For example, providing the version of python34 tries to install python3-pip which isn't a valid EPEL package name, and so there's a failure there. This is true for a number of the combinations listed in the original issue (#303).

To complicate things a little bit further, EPEL now has a python36 package, but no matching pip3 package - installing pip3 requires python34 to be installed from EPEL.

jameskirsop avatar Oct 24 '18 20:10 jameskirsop

Hey @jameskirsop. Are you able to provide a PR with a potential fix or one that provides an acceptance test that fails? So we can narrow down the issue.

bastelfreak avatar Nov 02 '18 10:11 bastelfreak

@bastelfreak Yep! I actually hacked on together for my environments so I could use the rest of the module. You can review the diff here: https://github.com/jameskirsop/puppet-python/commit/137212ff0c06ce6ef7d0ab4027c4aa79250d6c60

If you think it's PR worthy, I'm happy to create one, but I wasn't sure if it was up-to-scratch.

jameskirsop avatar Nov 02 '18 11:11 jameskirsop

That looks okay, can you provide it as a PR? Please don't add :: leading for variables and use the facts hash facts instead of topscope variables.

bastelfreak avatar Nov 02 '18 11:11 bastelfreak

It seems like #489 has fixed many of these issues, but I'm still having some.

In summary, when using the following: site.pp

class { 'python':
    version => 'python36',
    virtualenv => present,
}

hiera for the group of hosts I'm wanting to deploy a virtualenv to

python::python_virtualenvs:
  "/etc/zabbix/userparam_venv_puppetmonitor":
    version: "36"
    virtualenv: "virtualenv-3"

I'm experiencing the issue described in this StackOverflow post.

If I run the suggested resolution:

etc/zabbix/userparam_venv_puppetmonitor/bin/python -m ensurepip --upgrade
Looking in links: /tmp/tmpozkrguk5
Requirement already up-to-date: setuptools in /etc/zabbix/userparam_venv_puppetmonitor/lib/python3.6/site-packages (41.0.1)
Requirement already up-to-date: pip in /etc/zabbix/userparam_venv_puppetmonitor/lib/python3.6/site-packages (19.2.1)

It would seem that when the virtualenv is set up, some incompatible version of pip is deployed.

Some additional info:

/etc/zabbix/userparam_venv_puppetmonitor/bin/pip --version
pip 19.2.1 from /etc/zabbix/userparam_venv_puppetmonitor/lib/python3.6/site-packages/pip (python 3.6)
pip3 --version
pip 8.1.2 from /usr/lib/python3.6/site-packages (python 3.6)

Perhaps we should upgrade pip3 on installation of python3, before it's used in a virtualenv?

jameskirsop avatar Jul 23 '19 23:07 jameskirsop

Just trying to bump this one up, I've not come up with a suitable way forward yet, but still experiencing issues on CentOS7.

Things to factor in:

  • virtualenv-3 is not installed by this module, and it should be if used on CentOS with python3.6
  • virtualenv-3 should be the default vitualenv binary if the above is true, specified in the modules manifest

jameskirsop avatar Apr 14 '20 01:04 jameskirsop