Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

python_execute with virtualenv specified can't see pip it just installed #54

Open
jblaine opened this issue Apr 22, 2016 · 2 comments
Open

Comments

@jblaine
Copy link
Contributor

jblaine commented Apr 22, 2016

I can't win this week :(

python_runtime '2' do
  provider :system
end

python_virtualenv node['r701-graphite']['server']['approot'] do
  user node['r701-graphite']['server']['user']
end

python_package 'whisper' do
  version node['r701-graphite']['server']['whisper_version']
end

python_package 'carbon' do
  version node['r701-graphite']['server']['carbon_version']
end

# graphite-web 0.9.15 package has a bug:
# https://github.com/graphite-project/graphite-web/issues/1508
# led to me using options with python_package
# which led to:
# https://github.com/poise/poise-python/issues/53
# which led to this code being commented out :(
# python_package 'graphite-web' do
#   options '--install-option="--prefix=/opt/graphite" --install-option="--install-lib=/opt/graphite/webapp"'
#   version node['r701-graphite']['server']['graphite_web_version']
# end

python_execute 'Install graphite-web a specific way' do
  command "pip install graphite-web==#{node['r701-graphite']['server']['graphite_web_version']} --install-option='--prefix=/opt/graphite' --install-option='--install-lib=/opt/graphite/webapp'"
  virtualenv node['r701-graphite']['server']['approot']
end
* python_runtime_pip[2] action install (up to date)
* python_package[setuptools] action install (up to date)
* python_package[wheel] action install (up to date)
* python_package[virtualenv] action install (up to date)
 (up to date)
* python_virtualenv[/etc-metrics.our.org/graphite] action create
  * python_runtime_pip[/etc-metrics.our.org/graphite] action install (up to date)
  * python_package[setuptools] action install (up to date)
  * python_package[wheel] action install (up to date)
   (up to date)
* python_package[whisper] action install (up to date)
* python_package[carbon] action install (up to date)
* python_execute[Install graphite-web a specific way] action run
  [execute] /etc-metrics.our.org/graphite/bin/python: can't open file 'pip': [Errno 2] No such file or directory
...
  Mixlib::ShellOut::ShellCommandFailed
  ------------------------------------
  Expected process to exit with [0], but received '2'
  ---- Begin output of /etc-metrics.our.org/graphite/bin/python pip install graphite-web==0.9.15 --install-option='--prefix=/opt/graphite' --install-option='--install-lib=/opt/graphite/webapp' ----
  STDOUT:
  STDERR: /etc-metrics.our.org/graphite/bin/python: can't open file 'pip': [Errno 2] No such file or directory
  ---- End output of /etc-metrics.our.org/graphite/bin/python pip install graphite-web==0.9.15 --install-option='--prefix=/opt/graphite' --install-option='--install-lib=/opt/graphite/webapp' ----
  Ran /etc-metrics.our.org/graphite/bin/python pip install graphite-web==0.9.15 --install-option='--prefix=/opt/graphite' --install-option='--install-lib=/opt/graphite/webapp' returned 2
@jblaine
Copy link
Contributor Author

jblaine commented Apr 22, 2016

tmp:etc-metrics# ls /etc-metrics.our.org/graphite/bin/pip*
pip     pip2    pip2.7
tmp:etc-metrics#

@coderanger
Copy link
Member

Change your execute to be -m pip and it will work 1000% better and more consistently :) It skips the pip binary and runs it internally as a module.

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

No branches or pull requests

2 participants