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

Pip install runs on every puppet run. #218

Closed
eabrouwer3 opened this issue Jul 23, 2015 · 16 comments
Closed

Pip install runs on every puppet run. #218

eabrouwer3 opened this issue Jul 23, 2015 · 16 comments

Comments

@eabrouwer3
Copy link

On every run of my puppet agent, it runs a pip install, both when I have

ensure => present,

or,

ensure => latest,

There has to be a better way to check if it's already the latest version or installed, without just running and Exec for pip install package or pip install --upgrade package. It takes up a lot of time in the agent's run when I'm installing a lot of packages.

@ekohl
Copy link
Member

ekohl commented Sep 16, 2015

Not to mention that your host will stay in active instead of converging to a stable state.

@igalic
Copy link
Contributor

igalic commented Sep 21, 2015

which version of the module are you using, @supereman16 / @ekohl ?

@tremblaysimon
Copy link
Contributor

If we don't talk about #193, I think there is sometimes a "strange" behavior when a package has just been updated on PyPI. The pip search package_name command doesn't return the real latest version. I don't know how pip search works but after a couple of minutes the information is updated and the behavior will be the right one (since in pip.pp it uses pip search command).

@ekohl
Copy link
Member

ekohl commented Sep 21, 2015

@igalic 1.9.5 here.

I'm wondering if in my case I can blame it on using sentry[postgres], pip freeze not reporting that back and $grep_regex doesn't simplify it to sentry. One can also wonder if that's desired because when a user changes the package from sentry to sentry[postgres] will report as done while in fact it isn't.

@adamcstephens
Copy link
Contributor

Have you checked your call to python::pip ? pip will install a package with a different case, but the grep in the the definition will always fail so puppet will try and reinstall it.

@ekohl
Copy link
Member

ekohl commented Jan 22, 2016

@adamcstephens I think that's exactly the problem. However, when you simplify sentry[postgres] to sentry it becomes impossible to change your manifest from the latter to the former.

@jordigg
Copy link

jordigg commented Feb 2, 2016

I have the same problem but just for one package (I'm just installing two of them). I'm using the following code:

    #install python + pip
    class { 'python' :
        version     => 'system',
        pip         => 'present',
        dev         => 'absent',
        virtualenv  => 'absent',
        gunicorn    => 'absent',
        require     => Exec['apt-update'],
    }

    #install python semantic_version
    python::pip { 'semantic_version' :
        pkgname => 'semantic_version',
        ensure  => 'present',
        require => Class['python'],
    }

    #install python sphinx
    python::pip { 'sphinx' :
        pkgname => 'sphinx',
        ensure  => 'present',
        require => Class['python'],
    }

semantic_version gets reinstalled on every run, sphinx doesn't. Any clues why semantic_version keeps being reinstalled? Running pip install semantic_version and pip install sphinx I get the same response Requirement already up-to-date ...

@adamcstephens
Copy link
Contributor

hyphen != underscore:

❯ pip freeze | grep semantic
semantic-version==2.4.2

@jordigg
Copy link

jordigg commented Feb 3, 2016

My bad... I don't know were I saw that the package name was with an underscore... New to Python and pip so because it was installing just fine I didn't see that mistake. Thanks so much @adamcstephens

@zachfi
Copy link
Contributor

zachfi commented Apr 27, 2016

I'm running into this as well, though not trying to install any pip packages yet. Simply using the pip provider on the python class look for the incorrect path of pip here: https://github.com/stankevich/puppet-python/blob/master/manifests/install.pp#L74

@gdubicki
Copy link

gdubicki commented Nov 2, 2016

Same here for both 1.7.16 and 1.9.1 versions with the following code:

python::pip { 'pip':
    ensure     => '8.1.0',
    pkgname    => 'pip',
    virtualenv => $::myapp::virtualenv_path,
}

@zachfi
Copy link
Contributor

zachfi commented Nov 2, 2016

Here is the fork I've been keeping to get out of some oddities in this module, such as this issue: https://github.com/xaque208/puppet-python

@gdubicki
Copy link

gdubicki commented Nov 2, 2016

Thanks @xaque208, your fork looks interesting, but I need Puppet 3.8 support.

@igalic
Copy link
Contributor

igalic commented Nov 18, 2016

@gdubicki keep in mind that puppet 3.x is eol at the end of the year

@stankevich
Copy link
Collaborator

See #390

@maltewhiite
Copy link

maltewhiite commented Oct 5, 2021

@stankevich
#390
I am having this issue.

$python_packages = ['argparse', 'regex', 'prometheus_client']
  package { $python_packages:
    ensure   => installed,
    provider => pip3,
}

causes this every time:

Notice: /Stage[main]/Monitoring/Package[argparse]/ensure: created
Notice: /Stage[main]/Monitoring/Package[prometheus_client]/ensure: created

I land on this issue from Google.

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

No branches or pull requests

10 participants