-
Notifications
You must be signed in to change notification settings - Fork 820
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
Not able to push new lambda function changes via amplify push. Error: Could not find a pipenv site-packages directory #6159
Comments
@heng2j I'm having the exact same issue. Have you found a workaround yet? |
➜ ~ python3 --version
Python 3.9.1
➜ ~ pipenv --version
pipenv, version 2020.11.15 |
Can you try this:
Let me know if this works for you? |
For me, I checked that I only have python3.7 in my lambda function's virtualenv. So I have to renamed it manually to 3.8 to fix this issue. /Users/heng2j/.virtualenvs/collectorVideosProcessor-r9qVMPot/lib/python3.8/site-packages |
Closing due to lack of response. |
UPDATE: Scratch that. It appears I would have to run pull before push every time. It's no fix. I'll tell you what seems to reliably do the trick:
|
thanks @rt-demetri this worked for me pipenv run amplify push |
I had the same problem. I needed this for an amplify lambda, the default path is not the path used by my lambda. |
I'm having a similar problem. When I add a new lambda function I have to cd into the folder and run pipenv shell, then amplify push works. So I have to have a separate pipenv virtual environment for EVERY lambda function? Where are the docs on how to properly use pipenv and add a python lambda function with amplify. I should just be able to follow a doc and it should work. |
But default i still get this issue and i can't do a |
@bfleming-ciena i agree this is not resolved |
Also seeing this issue. Anyone find a workaround yet? Neither @rt-demetri or @bfleming-ciena solutions worked for me. |
This worked for me, I don't normally reply lol. Thank you and @akshbhu. |
Maybe @heitorlessa can help with a suggestion on how to fix this in the Amplify cli? |
I have also encountered this problem. I don't know why this works, but the problem is solved. |
Funny thing you should mention that. I think each first time you run Python in an amplify project, it leaves behind version information in a pipfile or something like that. Subsequent runs with a different version of Python will see the different version listed and you run into situations such as this issue. Another coworker unknowingly updated the pipfile (by means of running a multitude of different pip/pipenv commands) and suddenly I’m not getting the error anymore. Next time I’m in that code, I’ll take a look at the commit. |
That's right. Changing "python3.8 to python3.9 version" Methods was only possible once.... Maybe my Python version and pipfile have compatibility confilcts. |
Same problem just resolved. There is a mistake in the project in my case. My college setup python 3.8 in the functions, but use 3.9 in the Pipefile under the root of project. So pipenv kept looking for site-packages under python-3.9 instead of python-3.8. After set python 3.8 in the pipefile, I followed what akshbhu said:
It works now. |
Closing this issue. |
Maybe we can clarify how this should work in the AWS Amplify docs? |
I personally had my machine have two versions of python3 (3.8 and 3.9). Resolved my issue by specifying python version as 3.8 in Pipfile and Pipfile.lock then ran |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Describe the bug
A clear and concise description of what the bug is.
I am not able to do amplify push after making any changes to one of my lambda function. For example simply remove a single space.
I am receiving this error:
Amplify CLI Version
You can use
amplify -v
to check the amplify cli version on your system4.39.0
To Reproduce
Steps to reproduce the behavior or terminal output if applicable
I am putting my python dependencies in another lambda layer for that lambda function at opt/python
And I am using runtime Python 3.7 instead. But I have tried to run Python 3.8
Expected behavior
A clear and concise description of what you expected to happen.
Successful push changes to the lambda function.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
node -v
to check the node version on your systemv12.13.0
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: