【发布时间】:2018-05-04 22:40:35
【问题描述】:
我正在尝试在 Elastic Beanstalk 中设置 django 环境。当我尝试通过 requirements.txt 文件安装时遇到了 python3.6 问题。
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 环境并使用以下方法将其删除时:
/opt/python/run/venv/bin/pip3 uninstall enum34
我得到同样的错误,表明 venv 在某种程度上被破坏了。我该如何解决这个问题?以下是我传入环境中的扩展文件供参考:
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
container_commands:
01_migrate:
command: "./manage.py migrate"
leader_only: true
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: yahoo_serp.settings
【问题讨论】:
标签: python django amazon-web-services pip