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

zappa not using virtualenv python-dateutil #1560

Open
rhyspowell opened this issue Jul 11, 2018 · 9 comments
Open

zappa not using virtualenv python-dateutil #1560

rhyspowell opened this issue Jul 11, 2018 · 9 comments

Comments

@rhyspowell
Copy link

When trying to update getting the following error. This was previously deployed and updated on another machine.
As can be seen from the output its calling directly from system packages despite the correct versions being available in the virtual environment

`(venv) ➜ fatalshadows git:(master) ✗ zappa update dev [20/479]
(python-dateutil 2.7.3 (/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages), Requirement.parse('python-dateutil==2.6.1'), {'zappa'})
Calling update for stage dev..
Oh no! An error occurred! :(

==============

Traceback (most recent call last):
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/zappa/cli.py", line 2610, in handle
sys.exit(cli.handle())
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/zappa/cli.py", line 505, in handle
self.dispatch_command(self.command, stage)
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/zappa/cli.py", line 549, in dispatch_command
self.update(self.vargs['zip'], self.vargs['no_upload'])
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/zappa/cli.py", line 877, in update
self.create_package()
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/zappa/cli.py", line 2171, in create_package
disable_progress=self.disable_progress
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/zappa/core.py", line 447, in create_lambda_zip
import pip
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/pip/init.py", line 45, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/pip/vcs/mercurial.py", line 9, in
from pip.download import path_to_url
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/pip/download.py", line 40, in
from pip._vendor import requests, six
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/pip/_vendor/requests/init.py", line 98, in
from . import packages
File "/Users/rhyspowell/.pyenv/versions/3.6.2/lib/python3.6/site-packages/pip/_vendor/requests/packages.py", line 12, in
sys.modules['pip._vendor.requests.packages.' + mod] = sys.modules["pip._vendor." + mod]
KeyError: 'pip._vendor.urllib3.contrib'

==============

Need help? Found a bug? Let us know! :D
File bug reports on GitHub here: https://github.com/Miserlou/Zappa
And join our Slack channel here: https://slack.zappa.io
Love!,
~ Team Zappa!
(venv) ➜ fatalshadows git:(master) ✗ pip install python-dateutil==2.6.1
Requirement already satisfied: python-dateutil==2.6.1 in ./venv/lib/python3.6/site-packages
Requirement already satisfied: six>=1.5 in ./venv/lib/python3.6/site-packages (from python-dateutil==2.6.1)
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.`

deactivation and down grading the system version allowed the deployment to be made

`(venv) ➜ fatalshadows git:(master) ✗ deactivate
➜ fatalshadows git:(master) ✗ pip install python-dateutil==2.6.1
Collecting python-dateutil==2.6.1
Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/4b/0d/7ed381ab4fe80b8ebf34411d14f253e1cf3e56e2820ffa1d8844b23859a2/python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
100% |████████████████████████████████| 194kB 1.1MB/s
Requirement already satisfied: six>=1.5 in /Users/rhyspowell/.local/lib/python3.6/site-packages (from python-dateutil==2.6.1)
Installing collected packages: python-dateutil
Found existing installation: python-dateutil 2.7.3
Uninstalling python-dateutil-2.7.3:
Successfully uninstalled python-dateutil-2.7.3
Successfully installed python-dateutil-2.6.1
You are using pip version 9.0.2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
➜ fatalshadows git:(master) ✗ . venv/bin/activate
(venv) ➜ fatalshadows git:(master) ✗ zappa update dev
Calling update for stage dev..
Downloading and installing dependencies..

  • cryptography==2.2.2: Warning! Using precompiled lambda package version 1.9 instead!
  • cffi==1.11.5: Downloading
    100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 421K/421K [00:00<00:00, 2.21MB/s]
  • sqlite==python36: Using precompiled lambda package
    Packaging project as zip.
    Uploading elite-pilot-por-dev-1531335769.zip (9.8MiB)..
    100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.3M/10.3M [00:08<00:00, 1.47MB/s]
    Updating Lambda function code..
    Updating Lambda function configuration..
    Uploading elite-pilot-por-dev-template-1531335803.json (1.6KiB)..
    100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.64K/1.64K [00:00<00:00, 7.30KB/s]
    Deploying API Gateway..
    Your updated Zappa deployment is live!:`

Your Environment

Macos High Sierra 10.13.5
zappa version 0.46.1

(venv) ➜ fatalshadows git:(master) ✗ pip freeze argcomplete==1.9.3 arrow==0.12.1 asn1crypto==0.24.0 Authlib==0.8 base58==1.0.0 blinker==1.4 boto3==1.7.55 botocore==1.10.55 certifi==2018.4.16 cffi==1.11.5 cfn-flip==1.0.3 chardet==3.0.4 click==6.7 cryptography==2.2.2 docutils==0.14 durationpy==0.5 Flask==1.0.2 Flask-DebugToolbar==0.10.1 future==0.16.0 hjson==3.0.1 idna==2.7 itsdangerous==0.24 Jinja2==2.10 jmespath==0.9.3 kappa==0.6.0 lambda-packages==0.20.0 MarkupSafe==1.0 placebo==0.8.1 pycparser==2.18 pygal==2.4.0 python-dateutil==2.6.1 python-dotenv==0.8.2 python-slugify==1.2.4 PyYAML==3.12 requests==2.19.1 s3transfer==0.1.13 six==1.11.0 toml==0.9.4 tqdm==4.19.1 troposphere==2.3.1 Unidecode==1.0.22 urllib3==1.23 Werkzeug==0.14.1 wsgi-request-logger==0.4.6 zappa==0.46.1 You are using pip version 9.0.3, however version 10.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

@ceefour
Copy link

ceefour commented Jul 17, 2018

Zappa please update to python-dateutil >= 2.7.3

@davesave
Copy link

davesave commented Aug 5, 2018

zappa 0.46.2 has requirement python-dateutil<2.7.0,>=2.6.1, but you'll have python-dateutil 2.7.3 which is incompatible.

@rhyspowell
Copy link
Author

Which is fine but it's calling dateutil from my system python, not the virtual env. I don't want to have to keep changing versions everytime I run this project. I believe since the last time tun, zappa has been upgraded, has it fixed this issue?

@prattcmp
Copy link

prattcmp commented Apr 1, 2019

This is still an issue AFAIK.

@LeggoMahEggo
Copy link

Getting this issue with zappa 0.48.2

@gonwi
Copy link

gonwi commented Nov 14, 2019

Still an issue

@MikaylaRobinson
Copy link

I added python-dateutil==2.6.1 to my requirements before zappa and it worked for me.

@Number77asa
Copy link

pip install python-dateutil==2.6.1

@degun
Copy link

degun commented Apr 28, 2020

getting this issue with zappa-0.51.0

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

9 participants