-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to import module 'handler': No module named werkzeug.wrappers #64
Comments
Zappa needs to be used in a virtualenvironment. You shouldn't use sudo and pip together. |
well, I've tried it out in a virtualenv, still get the same error.
|
I think this issue is actually this issue (#63). Can you rename your virtualenv to env (or probably anything that isnt the same name as your project) and see what happens? |
I agree |
Update -- this also happens when flask is not installed in the virtualenv. |
@collingreen THANK YOU ! |
Seeing this same issue while trying to use zappa with apistar (0.3.9).
I've rebuilt my venv several times with no effect...no sure what to try next.
|
@Miserlou any advice for the
error ? Getting this same issue trying to deploy a django service. Flask & Werkzeug are installed in the venv, name is not conflicting. |
@Sniedes722 Downgrading to 0.44.3 fixed the issue for me. |
Can anybody figure out where the regression was committed? Or what it is? |
This happens to me with When the handler venv pip install tries to happen it tries to install toml==0.9.3 but it can't find it. Maybe we could ask toml to bump their version.
I asked the maintainer to cut a new release in that issue. It seems weird stuff is happening because v0.9.3.1 on pypi still references itself as 0.9.3 in code. So if this is the problem we either wait for upstream or temporarily downgrade to 0.9.2 :/ |
Same issue, I'm trying to use slim_handler = True for my flask-ask skill but I get the same error message. Really hope they fix this soon! |
Would this be solved if Zappa didn't peg requirement versions? |
Im failing to update my zappa projects due to this " Could not find a version that satisfies the requirement toml==0.9.3 (from versions: 0.6.0, 0.6.5, 0.7.0, 0.7.1, 0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.9.1, 0.9.2, 0.9.3.1) No matching distribution found for toml==0.9.3". Unfortunately it shows the error but still deploys it; breaking the previously working api. Is there a way for the deployment to fail if some requirements aren't met? |
The same issue with toml. Can this be manually solved? |
toml has released 0.9.4 |
@Miserlou Is it caused by toml? |
Getting a similar error: Unable to import module 'handler': attempted relative import with no known parent package. (And earlier also: Unable to import module 'handler': No module named 'werkzeug' ) Windows 10, Python 3.6.2. Virtual environment name does not conflict. I have deleted and recreated several times, most recently with --no-site-packages. Spot checked some and found all are in .\venv\Lib\site-packages. handler.py of course is there too. Downgraded Zappa from 0.45.1 to 0.44.3. My project does include toml 0.9.4. Zappa settings:
Any suggestions? I am stumped. |
Ultimately, I fixed this by doing a clean deployment with a new function name and keeping more default settings in zappa-settings, particularly apigateway_enabled. |
Getting this too, unfortunately, and am pretty stumped. Amazon Linux, Python 3.6. All my packages are inside of my virtualenv, which is named |
@aphelionz I had to hack my # AWS broke pip. )-:
pip install --user --ignore-installed boto3 six virtualenv pip==9.0.3
export PYTHONPATH=$HOME/.local
# ...
$HOME/.local/bin/pip install --user --upgrade virtualenv
# now build the venv
rm -rf /tmp/venv
virtualenv /tmp/venv
. /tmp/venv/bin/activate
/tmp/venv/bin/pip install --ignore-installed pip==9.0.3
PYTHONPATH=`pwd`:$PYTHONPATH
/tmp/venv/bin/pip install --no-cache-dir --upgrade -r requirements.txt |
hmm same error :( the only thing i changed in your code was, in creating the virtualenv:
|
Could this be caused by #905 ? At least for me it was fixed by copying contents of |
I'm hitting this as well... if I unzip the handler_*.zip file the packaging deploys I'm noticing that werkzeug is not installed. This is all that's in there:
|
I can reliably reproduce this issue using this repo: https://github.com/sheats/zappa_issue
|
Turns out my problem was not activating the venv properly, this fixed it: https://github.com/sheats/zappa_issue/commit/331f69870320b31f6166731585ec7ae7dd8680fb I thought the entrypoint.sh was activating the venv correctly but apparently not. |
Copying the contents of |
I just solved this issue for me a few minutes ago. I deleted my env using python3.6 and created a new one using 3.7. once in the new env, and after |
Make sure you run |
I did a 'pip freeze >requirements.txt' and verified both zappa and flask were present in requirements.txt prior to 'zappa init'. Still having this problem. |
This worked for me, too. Was using Cloud9 IDE, which had Python3.6, and had to install Python3.7 first, then create a new venv using Python3.7, reinstall everything, and everything works after that. |
Same here. Windows 10, py 3.7, tried everything recommended here and then some, still no luck. if I run python after activating my env and run |
For me, I was creating separate 'run' steps in a CircleCI workflow/job for sourcing the virtualenv and running zappa update. But eventually bringing all shell commands under same 'run' step made the virtualenv persistent and the issue was solved. |
Im my case, I had Zappa installed thru homebrew, but also installed inside the venv. After i uinstalled from homebrew and only used venv that worked. |
I tried installing Werkzeug but it seems like it is already installed
~/dev/testzappa% sudo pip install Werkzeug Requirement already satisfied (use --upgrade to upgrade): Werkzeug in /usr/lib/python2.7/site-packages
I guess it isn't packaged into the lambda.
I get the following error in my lambda cloudwatch logs
Unable to import module 'handler': No module named werkzeug.wrappers
The text was updated successfully, but these errors were encountered: