-
Notifications
You must be signed in to change notification settings - Fork 824
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
Problem with pipenv when deploying #9948
Comments
Seems to work when i remove the
line in the Pipfile? The lambda seems to still work so I'm not sure why you have that in there since you copy all the files anyway? |
Also, I'm getting this error when the CI tries to build the project
Wrong version of python?! |
Hey @awhillas 👋 thanks for raising this! For the hosting pipeline issue regarding the Python version, I'm checking to see if there's an easier way to re-map the python3 binary but for the mean time it appears folks have been able to successfully use later versions of python by modifying the buildspec ( For the pipfile line, I wasn't able to reproduce the issue with the default python template in Windows with WSL, however I will investigate this further |
thanks @josefaidt I rebuilt the project from scratch and it seems to have righted itself. I;ll have a look into the build spec. Thanks! |
@josefaidt I seem to be getting this error again. Steps:
Choose the python option with all the defaults.
then i get the error
I'm assuming this has something to do with the default python function setup.py? There is an issue on pipenv project about it. What is the official way to install dependencies in python lambda functions? Is it possible to just specify a |
Actually, i think i fixed it. It was because i used |
Hey @awhillas no trouble at all :) I'm glad to hear you're back up and running 🙌 , and that is an interesting note regarding the |
I'm still having issues on auto deploy with CI/CD. It gets through most of the backend build steps but then it gets to
|
I am having a similar problem. I create a python function. And when I try to push, mock, or cd to the function path and run pipenv install, i get the following.... Locking [packages] dependencies... FileNotFoundError: [Errno 2] No such file or directory: '/Users/leo/.local/share/virtualenvs/testFunction-asdhjdy/bin/python' I have uninstalled and re-installed pipenv as discussed above. I've deleted and recreated the function. Always the same. |
Is there any update on this? |
Even if I do this I got this following issue in latest amplify build:
I have this amplify.yml file:
|
I've just had this issue when trying to add a dependency to an an existing lambda editing the Pipfile. In my case could not trigger the mock of the function locally. After getting arround thinking that the problem was my docker setup for this, found out that the problem is the auto-generated setup.py file which is not compatible with pipenv and wheel problem (python 3.8 in my case). for the ones that know python more than me, the previous error is easy, but was not my case. In my case had to dig up the documentation to find out how the "src-layout" was supposed to work. To solve this I've set the setup.py file
and violá... issue fixed! Hope this prevent someone else the trouble of hours frustration. Might be that with this issue we got a better messaging next time: pypa/pipenv#5155 |
Thanks a lot, @esteban-serfe ! It fixed the github CI/CD issue and successfully deployed the app in amplify cloud. But now, I ran into a new problem while I am trying to execute
Before fixing the deploy issue with your solution, |
Unfortunately my knowhow on python on windows is limited. Sounds like the src dependency is not been able to be installed. Is that the first or the last dependency on the packages section? Usually I delete the virtualenv for that labda and the install process start again without issue. |
Sure, thanks for your input anyway. src dependency is the last in the packages section. |
Hi @esteban-serfe , the python issue is solved now. I just reinstalled the pipenv |
FWIW, I came searching for this error message. I was able to resolve just by doing an amplify pull. Making changes and then my amplify push succeeded afterwards. |
I also got a pipenv problem again; just to record, the exact issue was: FileNotFoundError: [Errno 2] No such file or directory: '[path]/[lambda_function_virtual_env]/bin/python' but the amplify pull and then push didn't work this time. My steps to resolve this time were: not sure how this all happened, but hopefully someone else might find this useful. |
fucking disgracful how AWS support does not do anything with this shitty python support, I recommend posting these issues on Linkedin and tagging AWS |
For those still tortured by errors like this and stuck waiting for Gen 2 migration tools, I've been able to successfully upgrade my existing python 3.8 runtimes to python 3.11 on AL2023, incorporating some of the above methods - see this comment: Related PSA - python 3.8 lambda runtimes (despite them being default for amplify gen 1 lambda functions) are deprecated on AWS, which is the reason we were forced to migrate 😢 |
Before opening, please confirm:
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v14.19.0
Amplify CLI Version
7.6.23
What operating system are you using?
Windows > WSL2 > Ubuntu20.04
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No none
Amplify Categories
api
Amplify Commands
add, push
Describe the bug
amplify api add
go through all the business and selectpython
stack. Everything default.amplify push
gives me this errorNot sure what the story is?
Expected behavior
To just deploy the functions
Reproduction steps
As above.
Also:
Python 3.8.10
pipenv, version 11.9.0
webapp/amplify/backend/function/getUploadedFiles/Pipfile:
webapp/amplify/backend/function/getUploadedFiles/src/setup.py:
I note that when i
I get the same error.
When i try (from that dir)
I get
Then
pipenv install
works but with the same error as above thusamplify push
still doesn't work?So looks like there is something wrong with the default pipenv setup?
GraphQL schema(s)
None
Log output
None
Additional information
None
The text was updated successfully, but these errors were encountered: