Skip to content
New issue

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

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

Already on GitHub? # to your account

Zappa update fails with "import pip" command #1446

Open
iwitaly opened this issue Mar 17, 2018 · 22 comments
Open

Zappa update fails with "import pip" command #1446

iwitaly opened this issue Mar 17, 2018 · 22 comments
Labels

Comments

@iwitaly
Copy link

iwitaly commented Mar 17, 2018

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?

@Miserlou
Copy link
Owner

Miserlou commented Mar 17, 2018 via email

@bmyrtil
Copy link

bmyrtil commented Mar 17, 2018

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

@iwitaly
Copy link
Author

iwitaly commented Mar 17, 2018

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.

@bmyrtil
Copy link

bmyrtil commented Mar 17, 2018

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

@lampslave
Copy link

lampslave commented Mar 17, 2018

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.

@bmyrtil
Copy link

bmyrtil commented Mar 17, 2018

Hmmm good catch. WIll try downgrading.

@iwitaly
Copy link
Author

iwitaly commented Mar 17, 2018

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

@bmyrtil
Copy link

bmyrtil commented Mar 17, 2018

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

@lampslave
Copy link

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

@Miserlou
Copy link
Owner

Reported upstream.

@lampslave
Copy link

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

@iwitaly
Copy link
Author

iwitaly commented Mar 19, 2018

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.

@iwitaly
Copy link
Author

iwitaly commented Mar 19, 2018

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

@leopard627
Copy link

leopard627 commented Mar 20, 2018

just downgrade pip pip install pip==8.1.2 :(

@anx-ckreuzberger
Copy link

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

@sibblegp
Copy link
Contributor

This also breaks new deployments. Downgrading to 9.0.1 works.

@jasonrhaas
Copy link

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

@scoates
Copy link
Collaborator

scoates commented Apr 12, 2018

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

@LOB-HarveyZ
Copy link

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

@faoujisoka
Copy link

faoujisoka commented Jun 12, 2018

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?

@jasonrhaas
Copy link

@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.

@orik123
Copy link

orik123 commented Feb 4, 2019

pip=19.0.1 works just fine

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

No branches or pull requests