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

[CentOS7 + Python 2.7]: python::virtualenv fails #365

Closed
chgarling opened this issue Apr 3, 2017 · 3 comments · Fixed by #421
Closed

[CentOS7 + Python 2.7]: python::virtualenv fails #365

chgarling opened this issue Apr 3, 2017 · 3 comments · Fixed by #421

Comments

@chgarling
Copy link

chgarling commented Apr 3, 2017

The creation of new virtualenvs fails with:

Error: true && virtualenv --no-site-packages -p python /opt/privacyidea && /opt/privacyidea/bin/pip wheel --help > /dev/null 2>&1 && { /opt/privacyidea/bin/pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { /opt/privacyidea/bin/pip --log /opt/privacyidea/pip.log install $wheel_support_flag --upgrade pip distribute || /opt/privacyidea/bin/pip --log /opt/privacyidea/pip.log install --upgrade pip distribute ;} returned 1 instead of one of [0]
Error: /Stage[main]/Projects::Privacyidea::Install/Python::Virtualenv[/opt/privacyidea]/Exec[python_virtualenv_/opt/privacyidea]/returns: change from notrun to 0 failed: true && virtualenv --no-site-packages -p python /opt/privacyidea && /opt/privacyidea/bin/pip wheel --help > /dev/null 2>&1 && { /opt/privacyidea/bin/pip wheel --version > /dev/null 2>&1 || wheel_support_flag='--no-use-wheel'; } ; { /opt/privacyidea/bin/pip --log /opt/privacyidea/pip.log install $wheel_support_flag --upgrade pip distribute || /opt/privacyidea/bin/pip --log /opt/privacyidea/pip.log install --upgrade pip distribute ;} returned 1 instead of one of [0]

The puppet code looks like this:

class { 'python' :
version => 'system',
pip => 'present',
dev => 'present',
virtualenv => 'present',
gunicorn => 'absent',
use_epel => false,
}

python::virtualenv { '/opt/privacyidea':
ensure => present,
version => 'system',
owner => 'root',
group => 'root',
cwd => '/opt/privacyidea',
}

Maybe this is in relation with #309. Actually we can not use the python::virtualenv class because of this error. Let me know if you need further information.

@tprestegard
Copy link

tprestegard commented Jul 26, 2018

Can we have an option to disable the hard-coded --no-binary :all: for pip installs (using python::virtualenv)? Trying to install something as basic as IPython for Python 2 fails because building one of its dependencies requires the 'flit' package, which doesn't offer Python 2 packages. I'm on Debian 9 with pip 18.0 and python 2.7.13. I've tried on Ubuntu 18.04 as well (same pip and Python versions) and gotten the same error.

Should be able to reproduce this by doing

virtualenv test_venv --python=/usr/bin/python2
source test_venv/bin/activate
pip install --no-binary :all: IPython

@tprestegard
Copy link

OK, I see that I can override this behavior by specifying extra_pip_args => '--no-binary :none:' in the python::virtualenv resource in my manifest file. I had to dig into the source code to figure this out and AFAIK it isn't documented anywhere, so it would be good to fix that, at least.

@bastelfreak
Copy link
Member

@tprestegard can you create a PR that updates the README.md?

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

Successfully merging a pull request may close this issue.

3 participants