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

Allow environment variables to be specified on pip_requirements resource #77

Open
fletchowns opened this issue Nov 2, 2016 · 1 comment

Comments

@fletchowns
Copy link

fletchowns commented Nov 2, 2016

I have psycopg2 in my requirements.txt which requires pg_config to be on the PATH. Mine wasn't so the install fails.

It seems like it might be useful to be able to specify environment variables on the pip_requirements resource for stuff like this, unless there's a better way to be going about this.

As a workaround I added a symlink to a location I knew was already on the existing PATH:

link "/usr/local/bin/pg_config" do
	to "/usr/pgsql-#{node["postgresql"]["version"]}/bin/pg_config"
end
@fletchowns
Copy link
Author

I think this one may also help with my broken uwsgi installation via pip_requirements as well. It ended up being because of /opt/chef/embedded/bin being on the PATH.

I was able to work around it by using an execute resource and resetting PATH:

execute "pip install -r requirements.txt" do
    environment({
        "PATH" => "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
    })
end

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

1 participant