Miserlou/Zappa

Zappa update fails with "import pip" command

iwitaly opened this issue ยท 22 comments

I use Gitlab CI for updating my Zappa app with the following script.

  - export PIPENV_VENV_IN_PROJECT=true
  - pip install pipenv
  - pipenv install
  - export VIRTUAL_ENV=.venv/
  - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID_DEV
  - export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY_DEV
  - export ENVIRONMENT=dev
  - pipenv run python manage.py migrate --settings=admin_dashboard.settings.dev
  - pipenv run zappa update dev

I also use lambci/lambda:build-python3.6 as a base image.

Until today all updates were good, but today I've got this error
image

What could that mean?

Good its not just me... Not sure what happened but this is no longer working for me as well. Worked last night. Really strange.

Nothing has changed from my side, I use the same Docker image and the same dependency file.
BTW on my local machine, everything works great.

Same here, I literally just redeployed my application and start receiving this error.

I tested with library/python:3.6.4-alpine3.7 & frolvlad/alpine-python3 and received the same error as @iwitaly

Do you have RUN pip install --upgrade pip wheel in your dockerfile? pip 9.0.2 was released today, I guess it may be broken.

Hmmm good catch. WIll try downgrading.

@lampslave I do use lambci/lambda:build-python3.6 image without any modification. What do you suggest?

Yup running "pip install pip==9.0.1" fixed my issue. Looks like something is up with 9.0.2

@iwitaly Try to add RUN pip install --upgrade "pip==9.0.1" into your dockerfile.

Reported upstream.

It seems that new setuptools also can break builds, if you found some problems try to freeze it too: "setuptools<39.0".

Do you know how to make it work with pipenv? Locking pipenv install pip=9.0.1 doesn't fix that error. I've switched to plain pip install -r requirements.txt but it's not good.

Importing pip inside code is not a good practice. Is there any reason to install dependencies in runtime?

just downgrade pip pip install pip==8.1.2 :(

It has been made clear in PIP Issue 5081 that this is due to directly importing pip within the code (import pip).

This also breaks new deployments. Downgrading to 9.0.1 works.

Anyone know if the pip version 9.0.3 fixes the issue? Or are we still pinning to 9.0.1?

Still pinning, but I think it's fixed in 9.0.3

pip 10.0.1 still got the issue with zappa. has to down grade 9.0.1 which everything works fine.

when I want to install the libraries with pip
This error appears :
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
and when I use this 'python -m pip install --upgrade pip' the same error appears
what should I do?

@faoujisoka Don't upgrade pip, stick with 9.0.1 since that works with Zappa. Just pin pip=-9.0.1 in your virtualenv and you should be fine.

pip=19.0.1 works just fine