我正在尝试引导服务器。我曾经使用“recipe [poise-python]”来安装软件包。现在我得到以下错误。怎么解决?

* python_package[setuptools] action upgrade

    ================================================================================
    Error executing action `upgrade` on resource 'python_package[setuptools]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of ["/usr/bin/python", "-", "setuptools"] ----
    STDOUT:
    STDERR: The python_package resource requires pip >= 6.1.0, currently 10.0.0
    ---- End output of ["/usr/bin/python", "-", "setuptools"] ----
    Ran ["/usr/bin/python", "-", "setuptools"] returned 1

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `tap'
    /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:207:in `language_command_shell_out!'
    /var/chef/cache/cookbooks/poise-languages/files/halite_gem/poise_languages/command/mixin.rb:222:in `block in language_command_mixin'
    /var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:317:in `pip_command'
    /var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:341:in `pip_outdated'
    /var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:209:in `check_package_versions'
    /var/chef/cache/cookbooks/poise-python/files/halite_gem/poise_python/resources/python_package.rb:189:in `load_current_resource'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/supervisor/recipes/default.rb

     32: python_package "setuptools" do
     33:   action :upgrade
     34: end
     35:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/supervisor/recipes/default.rb:32:in `from_file'

    python_package("setuptools") do
      package_name "setuptools"
      action [:upgrade]
      default_guard_interpreter :default
      declared_type :python_package
      cookbook_name "supervisor"
      recipe_name "default"
      parent_python nil
      timeout 900
    end

    System Info:
    ------------
    chef_version=14.0.202
    platform=ubuntu
    platform_version=16.04
    ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
    program_name=/usr/bin/chef-solo
    executable=/opt/chef/bin/chef-solo


Running handlers:
[2018-04-17T01:46:45+00:00] ERROR: Running exception handlers
Running handlers complete
[2018-04-17T01:46:45+00:00] ERROR: Exception handlers complete
Chef Client failed. 2 resources updated in 23 seconds
[2018-04-17T01:46:45+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-04-17T01:46:45+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-04-17T01:46:45+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: python_package[setuptools] (supervisor::default line 32) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of ["/usr/bin/python", "-", "setuptools"] ----
STDOUT:
STDERR: The python_package resource requires pip >= 6.1.0, currently 10.0.0
---- End output of ["/usr/bin/python", "-", "setuptools"] ----
Ran ["/usr/bin/python", "-", "setuptools"] returned 1

最佳答案

这是poise-python Cookbook和pip 10之间的兼容性错误。您可以使用pip_version资源上的python_runtime属性或节点属性(override['poise-python']['options']['pip_version'])将托管运行时的版本设置为9.0.3起作用。该错误消息很尴尬,因为我的regexp编写得很差,尽管由于pip的更改无论如何它都会失败。菜谱的更新版本将很快面市。

关于chef-infra - 厨师-STDERR : The python_package resource requires pip >= 6. 1.0,目前为10.0.0,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49868680/

10-09 18:53