python pip install要求强制不同的版本

时间:2018-04-13 18:23:48

标签: pip

说有一个requirements.txt定义:

pip install -r requirements.txt --force celery==3.1.0

有没有办法强制安装不同的版本,如:

// Create a Stripe client
var stripe = Stripe($('meta[name="stripe-key"]').attr('content'));
var elements = stripe.elements();

var card = elements.create('card', {
  hidePostalCode: true,
  style: {
    base: {
      iconColor: '#666EE8',
      color: '#31325F',
      lineHeight: '40px',
      fontWeight: 300,
      fontFamily: 'Helvetica Neue',
      fontSize: '15px',

      '::placeholder': {
        color: '#CFD7E0',
      },
    },
  }
});
card.mount('#card-element');

function setOutcome(result) {
  var successElement = document.querySelector('.success');
  var errorElement = document.querySelector('.error');
  successElement.classList.remove('visible');
  errorElement.classList.remove('visible');

  if (result.token) {
    // In this example, we're simply displaying the token
    successElement.querySelector('.token').textContent = result.token.id;
    successElement.classList.add('visible');

    // In a real integration, you'd submit the form with the token to your backend server
    var form = document.querySelector('form');
    //form.querySelector('input[name="token"]').setAttribute('value', result.token.id);
    form.submit();
  } else if (result.error) {
    errorElement.textContent = result.error.message;
    errorElement.classList.add('visible');
  }
}

card.on('change', function(event) {
  setOutcome(event);
});

document.querySelector('form').addEventListener('submit', function(e) {
  e.preventDefault();
  var options = {
    address_line1: document.getElementById('address-line1').value,
    address_city: document.getElementById('address-city').value,
    address_zip: document.getElementById('address-zip').value,
  };

  stripe.createToken(card, options).then(setOutcome);
});

0 个答案:

没有答案