aws-elastic-beanstalk-cli-setup: Compatibility with Python 3.12, ModuleNotFoundError: No module named 'imp'
eb tool broken after upgrade to python 3.12 due to imp module remotion (https://github.com/python/cpython/issues/98040)
Stacktrace:
Traceback (most recent call last):
File "/home/dmt/.ebcli-virtual-env/bin/eb", line 5, in <module>
from ebcli.core.ebcore import main
File "/home/dmt/.ebcli-virtual-env/lib/python3.12/site-packages/ebcli/core/ebcore.py", line 16, in <module>
from cement.core import foundation, handler, hook
File "/home/dmt/.ebcli-virtual-env/lib/python3.12/site-packages/cement/core/foundation.py", line 11, in <module>
from ..core import output, extension, arg, controller, meta, cache, mail
File "/home/dmt/.ebcli-virtual-env/lib/python3.12/site-packages/cement/core/extension.py", line 8, in <module>
from imp import reload # pragma: no cover
^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'imp'
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 29
- Comments: 21 (1 by maintainers)
Hi! I have the same problem on Python 3.12.4. The AWS documentation shows version 3.11 or later . https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-advanced.html Let’s put the reactions of those who are facing the same problem on python 3.12.4.
already solved!, just downgrade your python with version Python 3.11.7 and Pip version pip 23.2.1
Just ran into this. Devs., please update things so that it works on Python 3.12. The latest Ubuntu installs Python 3.12
This is fixed now. EB CLI >= 3.21.0 works with Python 3.12
At the very least this repo’s readme needs to be updated to clarify that python 3.12+ should NOT be used. This shouldn’t take too long…
I don’t get this - i thought the whole point of using python virtual environments is that you could specify a version of python to use. Why is it necessary to downgrade python when your installer is using a virtual environment to begin with? I can’t deploy my website right now because the person who set it up, created the deploy script using this ebcli tool and the tool won’t work on a newly upgraded machine because of this ‘imp’ package. I see a thread on the tool’s repository that it was already addressed and fixed back in February. So is this installer installing an older version of ebcli than the current one? I wish someone at AWS would address this as it’s very difficult to rely on amazon tools such as elastic beanstalk when the primary tool many developers are using in conjunction with it is broken and the only suggested fix is ‘change your php version back to something already out-of-date’ And this ticket is already 8 months old, and it’s still broken? wth aws??
if you are using windows 11 and python 3.12, i found that this works for me, hoping it helps someone else
check
py.exeon your systemcheck pythons on your system
install python 3.11 from dowloading a installer on python official site
check pythons again after
run eb-cli installer using python 3.11
run eb cli