# Easy Install Error for Pisa

**URL:** <https://discourse.chef.io/t/easy-install-error-for-pisa/1781>\
**Category:** Chef Infra (archive)\
**Created:** [April 21, 2011, 1:36am UTC](https://discourse.chef.io/t/easy-install-error-for-pisa/1781 "2011-04-21T01:36:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Spencer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/chris_spencer/32/833_2.png) [@Chris\_Spencer](https://discourse.chef.io/u/Chris_Spencer)\
**Post date:** [April 21, 2011, 1:36am UTC](https://discourse.chef.io/t/easy-install-error-for-pisa/1781/1 "2011-04-21T01:36:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [April 21, 2011, 2:04am UTC](https://discourse.chef.io/t/easy-install-error-for-pisa/1781/2 "2011-04-21T02:04:29Z")

</div>

Use the pip\_install LWRP in the Python cookbook. It shouldn't have  
this issue, plus pip \>\>\> easy\_install 🙂

--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

---

<div class="post-metadata">

**Author:** ![Chris\_Spencer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/chris_spencer/32/833_2.png) [@Chris\_Spencer](https://discourse.chef.io/u/Chris_Spencer)\
**Post date:** [April 21, 2011, 4:04pm UTC](https://discourse.chef.io/t/easy-install-error-for-pisa/1781/3 "2011-04-21T16:04:46Z")

</div>

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.net](mailto:noah@coderanger.net)wrote:

> Use the pip\_install LWRP in the Python cookbook. It shouldn't have this  
> issue, plus pip \>\>\> easy\_install 🙂
> 
> --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
