Easy Install Error for Pisa

Hi,

I’m new to Chef, and I’m trying to automate the installation of the Python
package “pisa”. I was hoping to use the “easy_install_package” function,
which I’m using like:

easy_install_package “pisa” do
version "3.0.27"
end

but this throws the error:

[myhost] err:
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/…/lib/chef/shell_out.rb:232:in
invalid!': Expected process to exit 0, but it exited with 1 (Chef::Exceptions::ShellCommandFailed) [myhost] err: ---- Begin output of python -c "import pisa; print pisa.__path__" ---- [myhost] err: STDOUT: [myhost] err: STDERR: Traceback (most recent call last): [myhost] err: File "<string>", line 1, in <module> [myhost] err: ImportError: No module named pisa [myhost] err: ---- End output of python -c "import pisa; print pisa.__path__" ---- [myhost] err: Ran python -c "import pisa; print pisa.__path__" returned 1 [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/shell_out.rb:218:inerror!’
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/…/lib/chef/mixin/shell_out.rb:33:in
shell_out!' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package/easy_install.rb:69:inload_current_resource’
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/…/lib/chef/resource.rb:394:in
run_action' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:53:inrun_action’
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/…/lib/chef/runner.rb:89:in
converge' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:ineach’
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/…/lib/chef/runner.rb:89:in
converge' [myhost] err: ... 13 levels... [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application.rb:62:inrun’
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/chef-solo:25
[myhost] err: from /usr/bin/chef-solo:19:in load' [myhost] err: from /usr/bin/chef-solo:19 [myhost] out: [Wed, 20 Apr 2011 21:14:43 -0400] ERROR: easy_install_package[pisa] (/tmp/chef/site-cookbooks/mysite/recipes/default.rb:68:infrom_file’) had
an error:

The problem seems to be that easy_install_package is running ‘python -c
"import pisa; print pisa.path"’, which of course will throw an error,
because the actual module imported is called “ho.pisa”, not “pisa”, even
though the egg file is simply called “pisa”. How can modify
easy_install_package to use the correct package name?

Regards,
Chris

Use the pip_install LWRP in the Python cookbook. It shouldn't have
this issue, plus pip >>> easy_install :slight_smile:

--Noah

On Apr 20, 2011, at 6:36 PM, Chris Spencer wrote:

Hi,

I'm new to Chef, and I'm trying to automate the installation of the
Python package "pisa". I was hoping to use the
"easy_install_package" function, which I'm using like:

easy_install_package "pisa" do
version "3.0.27"
end

but this throws the error:

[myhost] err: /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/
chef/shell_out.rb:232:in invalid!': Expected process to exit 0, but it exited with 1 (Chef::Exceptions::ShellCommandFailed) [myhost] err: ---- Begin output of python -c "import pisa; print pisa.__path__" ---- [myhost] err: STDOUT: [myhost] err: STDERR: Traceback (most recent call last): [myhost] err: File "<string>", line 1, in <module> [myhost] err: ImportError: No module named pisa [myhost] err: ---- End output of python -c "import pisa; print pisa.__path__" ---- [myhost] err: Ran python -c "import pisa; print pisa.__path__" returned 1 [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/ bin/../lib/chef/shell_out.rb:218:in error!'
[myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/
bin/../lib/chef/mixin/shell_out.rb:33:in shell_out!' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/ bin/../lib/chef/provider/package/easy_install.rb:69:in load_current_resource'
[myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/
bin/../lib/chef/resource.rb:394:in run_action' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/ bin/../lib/chef/runner.rb:53:in run_action'
[myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/
bin/../lib/chef/runner.rb:89:in converge' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/ bin/../lib/chef/runner.rb:89:in each'
[myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/
bin/../lib/chef/runner.rb:89:in converge' [myhost] err: ... 13 levels... [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/ bin/../lib/chef/application.rb:62:in run'
[myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/
chef-solo:25
[myhost] err: from /usr/bin/chef-solo:19:in load' [myhost] err: from /usr/bin/chef-solo:19 [myhost] out: [Wed, 20 Apr 2011 21:14:43 -0400] ERROR: easy_install_package[pisa] (/tmp/chef/site-cookbooks/mysite/recipes/ default.rb:68:in from_file') had an error:

The problem seems to be that easy_install_package is running 'python
-c "import pisa; print pisa.path"', which of course will throw
an error, because the actual module imported is called "ho.pisa",
not "pisa", even though the egg file is simply called "pisa". How
can modify easy_install_package to use the correct package name?

Regards,
Chris

Thanks. I dropped that recipe into my /cookbooks, and I now have this in my
default.rb:

python_pip "pisa" do
version "3.0.33"
action :install
end

However, now when I try and install, I get the error:

[myhost] err:
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package.rb:50:in
action_install': No version specified, and no candidate version available for python26 (Chef::Exceptions::Package) [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource.rb:395:in send'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource.rb:395:in
run_action' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:53:in run_action'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in
converge' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in each'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in
converge' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection.rb:94:in execute_each_resource'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
call' [myhost] err: ... 11 levels... [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application.rb:62:in run'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/chef-solo:25
[myhost] err: from /usr/bin/chef-solo:19:in load' [myhost] err: from /usr/bin/chef-solo:19 [myhost] out: [Thu, 21 Apr 2011 11:57:08 -0400] INFO: Ran execute[generate-module-list] successfully [myhost] out: [Thu, 21 Apr 2011 11:57:08 -0400] ERROR: package[python26] (/tmp/chef/cookbooks/python/recipes/package.rb:32:in from_file') had an
error:
[myhost] out: No version specified, and no candidate version available for
python26

I'm still standardized on Python 2.6.5, and I noticed the Opscode cookbooks
seem to assume 2.7. I tried changing default['python']['version'] = '2.6.5'
in python/attributes/default.rb, but that had no effect.

What else do I have to do to install support for python_pip?

Regards,
Chris

On Wed, Apr 20, 2011 at 10:04 PM, Noah Kantrowitz noah@coderanger.netwrote:

Use the pip_install LWRP in the Python cookbook. It shouldn't have this
issue, plus pip >>> easy_install :slight_smile:

--Noah

On Apr 20, 2011, at 6:36 PM, Chris Spencer wrote:

Hi,

I'm new to Chef, and I'm trying to automate the installation of the Python
package "pisa". I was hoping to use the "easy_install_package" function,
which I'm using like:

easy_install_package "pisa" do
version "3.0.27"
end

but this throws the error:

[myhost] err:
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/shell_out.rb:232:in
invalid!': Expected process to exit 0, but it exited with 1 (Chef::Exceptions::ShellCommandFailed) [myhost] err: ---- Begin output of python -c "import pisa; print pisa.__path__" ---- [myhost] err: STDOUT: [myhost] err: STDERR: Traceback (most recent call last): [myhost] err: File "<string>", line 1, in <module> [myhost] err: ImportError: No module named pisa [myhost] err: ---- End output of python -c "import pisa; print pisa.__path__" ---- [myhost] err: Ran python -c "import pisa; print pisa.__path__" returned 1 [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/shell_out.rb:218:in error!'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/mixin/shell_out.rb:33:in
shell_out!' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/provider/package/easy_install.rb:69:in load_current_resource'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/resource.rb:394:in
run_action' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:53:in run_action'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in
converge' [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in each'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:89:in
converge' [myhost] err: ... 13 levels... [myhost] err: from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/application.rb:62:in run'
[myhost] err: from
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/chef-solo:25
[myhost] err: from /usr/bin/chef-solo:19:in load' [myhost] err: from /usr/bin/chef-solo:19 [myhost] out: [Wed, 20 Apr 2011 21:14:43 -0400] ERROR: easy_install_package[pisa] (/tmp/chef/site-cookbooks/mysite/recipes/default.rb:68:in from_file') had
an error:

The problem seems to be that easy_install_package is running 'python -c
"import pisa; print pisa.path"', which of course will throw an error,
because the actual module imported is called "ho.pisa", not "pisa", even
though the egg file is simply called "pisa". How can modify
easy_install_package to use the correct package name?

Regards,
Chris