Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS 7 with Python3 does not work #303

Closed
prozach opened this issue Apr 27, 2016 · 9 comments · Fixed by #414 or #489
Closed

CentOS 7 with Python3 does not work #303

prozach opened this issue Apr 27, 2016 · 9 comments · Fixed by #414 or #489

Comments

@prozach
Copy link
Contributor

prozach commented Apr 27, 2016

Setting python::version to 3 as listed in the params::valid_versions doesn't work as the package python3 cannot be found. Looking in yum, only python34 looks to be valid. If I change the python::version to 34 (which is not listed as valid), python is installed, but I get a failure trying to install python3-pip, as the package does not exist in the the provided epel repo. This seems to me like it would be a common use case for this module. Any suggestions on how I should proceed?

@mwasilew2
Copy link

yea, I've hit exactly the same issue, primary use case for me

@wyardley
Copy link
Contributor

wyardley commented Jan 4, 2017

+1
I'm also not totally sure why the validation doesn't fail as it is now, since 'python34' works, but doesn't appear to fall within the validation rules. I have a python34-pip available, however, setting pip => present doesn't ensure it; I have to manually add the python34-pip package resource in my own calling code.

Another problem I'm having is that when not using SCL, even after making sure that pip3 is available, I don't see an easy way (either in hiera or otherwise) to have it use a system pip (not SCL or virtualenv) with a different name, e.g., pip3; am I missing something?

@wyardley
Copy link
Contributor

wyardley commented Jan 4, 2017

ps - maybe it could have a pip3 provider (similar to puppet's), or some kind of passthrough, vs. trying to figure out whether to use 'pip' or 'pip3'?

@prozach
Copy link
Contributor Author

prozach commented Jan 5, 2017

This has been implemented in the fork I'm using/maintaining. https://github.com/xaque208/puppet-python

@jameskirsop
Copy link

Unless I'm missing something, this issue still persists:

class { 'python' :
	version => '3',
	pip	=> 'present',
}

gives me a puppet run error:
Error: /Stage[main]/Python::Install/Package[pip]/ensure: change from 'purged' to 'present' failed: Execution of '/bin/yum -d 0 -e 0 -y install 3' returned 1: Error: Nothing to do

Changing version => 3 to version => python34 results in another puppet run error:
Error: /Stage[main]/Python::Install/Package[pip]/ensure: change from 'purged' to 'present' failed: Execution of '/bin/yum -d 0 -e 0 -y install python3-pip' returned 1: Error: Nothing to do

This is on CentOS7 with EPEL repos enabled.

Using the manifest example from the docs:

class { 'python' :
 ensure      => 'present',
 version     => 'rh-python36-python',
 dev         => 'present',
 virtualenv  => 'present',
}

gives me:

Error: Execution of '/bin/yum -d 0 -e 0 -y install rh-python36-python' returned 1: Error: Nothing to do
Error: /Stage[main]/Python::Install/Package[python]/ensure: change from 'purged' to 'present' failed: Execution of '/bin/yum -d 0 -e 0 -y install rh-python36-python' returned 1: Error: Nothing to do
Notice: /Stage[main]/Python::Install/Package[virtualenv]: Dependency Package[python] has failures: true
Warning: /Stage[main]/Python::Install/Package[virtualenv]: Skipping because of failed dependencies
Error: Execution of '/bin/yum -d 0 -e 0 -y install rh-python36-python-devel' returned 1: Error: Nothing to do
Error: /Stage[main]/Python::Install/Package[python-dev]/ensure: change from 'purged' to 'present' failed: Execution of '/bin/yum -d 0 -e 0 -y install rh-python36-python-devel' returned 1: Error: Nothing to do

Perhaps I'm doing wrong, but I've tried a number of documented and undocumented combinations that seem like they should work, but don't.

@danquack
Copy link
Contributor

danquack commented Sep 25, 2018

Hey @jameskirsop what do you see when you yum search? Curious to see what epel scl packages you have available .

@jameskirsop
Copy link

@danquack, I can't see where, within this module, that the SCL repos get enabled and I haven't manually installed them.

$ yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.internode.on.net
 * epel: epel.mirror.digitalpacific.com.au
 * extras: mirror.as24220.net
 * updates: mirror.as24220.net
repo id                                                                  repo name                                                                           status
!Zabbix_7_x86_64/x86_64                                                  Zabbix_7_x86_64                                                                        223
!Zabbix_nonsupported_7_x86_64/x86_64                                     Zabbix_nonsupported_7_x86_64                                                             4
!base/7/x86_64                                                           CentOS-7 - Base                                                                      9,911
!epel/x86_64                                                             Extra Packages for Enterprise Linux 7 - x86_64                                      12,687
!extras/7/x86_64                                                         CentOS-7 - Extras                                                                      403
!nginx-release/x86_64                                                    nginx repo                                                                             427
!puppet5/x86_64                                                          Puppet 5 Repository el 7 - x86_64                                                       95
!updates/7/x86_64                                                        CentOS-7 - Updates                                                                   1,348

I'm sure I'd get some SCL packages in yum search results if I installed it, but this sounds like something that should be handled by the puppet module, rather than by manual intervention.

Included amongst my current yum search python results are:

python34.x86_64 : Version 3 of the Python programming language aka Python 3000
python36.x86_64 : Interpreter of the Python programming language

@jameskirsop
Copy link

As a follow up, if I set provider => 'scl', SCL installs, and python apparently installs but I end up with the same issue that @prozach, @mwasilew2 and @wyardley reported.

I'm unsure on how #414 resolved the originally reported issue, but surely someone else would have picked up on this problem if it still persisted over the last two years - so I'm at a loss. It would seem that this issue was closed prematurely...?

@bastelfreak, as the closer, can you provide some insight?

@bastelfreak
Copy link
Member

This was maybe closed by accident. Can you open a new issue or a PR that adds your code to an acceptance test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants