Elastic Beanstalk中的enum34问题 [英] enum34 issue in Elastic Beanstalk
问题描述
我正在尝试在Elastic Beanstalk中设置django环境.尝试通过Requirements.txt文件进行安装时,我遇到了python3.6问题.
I'm trying to set up a django environment in Elastic Beanstalk. I am running into a python3.6 issue when I try to install through a requirements.txt file.
File "/opt/python/run/venv/bin/pip", line 4, in <module>
import re
File "/opt/python/run/venv/lib64/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
这是一个问题,我无法正确设置我的环境.一些搜索围绕着enum34
模块确定了问题的原因,但是当我尝试ssh进入我的EB环境并使用以下方法将其删除时:
I cannot set up my environment properly while this is an issue. Some searching around pinpointed the enum34
module as the cause of the issue, but when I try to ssh into my EB environment and remove it using:
/opt/python/run/venv/bin/pip3 uninstall enum34
我得到了同样的错误,表明venv在某种程度上被破坏了.我如何解决这个问题?这是我传递到环境中以供参考的扩展文件:
I get the same error, indicating the venv is broken in some way. How do I get around this issue? here are the extension files I pass into the environment for reference:
django.config:
django.config:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: yahoo_serp/wsgi.py
aws:autoscaling:launchconfiguration:
InstanceType: t2.large
packages:
yum:
libjpeg-turbo-devel: []
db-migrate.config
db-migrate.config
container_commands:
01_migrate:
command: "./manage.py migrate"
leader_only: true
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: yahoo_serp.settings
推荐答案
我遇到了同样的问题,通过从需求中删除django-enumfields来解决了这个问题.最重要的部分是更改后重建Elastic Beanstalk 环境.
I had the same issue, solved it by removing django-enumfields from the requirements. The most important part is to rebuild the Elastic Beanstalk environment after the change.
如果您仍然想使用enum34软件包,请尝试使用enum-compat(并重建Elastic Beanstalk).
If you still want to use enum34 package, try to use enum-compat (and rebuild the Elastic Beanstalk).
这篇关于Elastic Beanstalk中的enum34问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!