Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not install the same packages in different virtualenvs #18

Closed
romabysen opened this issue May 30, 2013 · 2 comments
Closed

Can not install the same packages in different virtualenvs #18

romabysen opened this issue May 30, 2013 · 2 comments

Comments

@romabysen
Copy link

If I create two virtualenvs, say A and B, and use python::pip to install gunicorn in both it will fail with this error:
Error 400 on SERVER: Duplicate declaration: Python::Pip[gunicorn] is already declared in file [.....]

This somewhat defeats the purpose of virtualenvs and it would be really nice if the same package could be installed in more than one virtualenv.

@sysreq0
Copy link

sysreq0 commented Mar 1, 2014

I wholeheartedly second that. Any idea if this can be worked out?

@lextoumbourou
Copy link

Hey guys,

This appears to have been fixed in this commit. If you specify the package name as a parameter and name the declaration something unique like:

python::pip { 'gunicorn-myenv':
    pkgname   => 'gunicorn',
    virtualenv  => $venv_path,
    owner       => $owner,
    require     => Python::Virtualenv[$venv_path],
}

It should get around this problem.

Thanks to @aelse for pointing this out.


If you can't install the latest version, another hacky work around is to specify the package name like: gunicorn#some-random-string. Pip appears to ignore everything after the # and Puppet is fooled into thinking it's a unique declaration.

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

No branches or pull requests

4 participants