Python中文
首页
教程
问答
标签
搜索
登录
注册
bash:/python/run/venv/bin/activate:没有这样的文件或目录
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正试图通过AWS elastic beanstalk部署我的django应用程序;在过去的两天里,我遇到了一个问题,我已经缩小了范围</p> <p>部署过程中的某个命令失败,此命令如下所示:</p> <pre><code>container_commands: 01_migrate: command: "python3 manage.py migrate" leader_only: true </code></pre> <p>AWS EB控制台日志中告诉我这一点的部分将我引向cfn-init.log,检查这一点告诉我同样的事情。然而,在cfn-init-cmd.log中,我看到了这一点</p> <pre><code>2020-06-19 18:24:24,753 P5019 [INFO] Command 01_migrate 2020-06-19 18:24:24,771 P5019 [INFO] -----------------------Command Output----------------------- 2020-06-19 18:24:24,771 P5019 [INFO] Traceback (most recent call last): 2020-06-19 18:24:24,771 P5019 [INFO] File "manage.py", line 10, in main 2020-06-19 18:24:24,771 P5019 [INFO] from django.core.management import execute_from_command_line 2020-06-19 18:24:24,771 P5019 [INFO] ModuleNotFoundError: No module named 'django' 2020-06-19 18:24:24,771 P5019 [INFO] 2020-06-19 18:24:24,771 P5019 [INFO] The above exception was the direct cause of the following exception: 2020-06-19 18:24:24,771 P5019 [INFO] 2020-06-19 18:24:24,772 P5019 [INFO] Traceback (most recent call last): 2020-06-19 18:24:24,772 P5019 [INFO] File "manage.py", line 21, in <module> 2020-06-19 18:24:24,772 P5019 [INFO] main() 2020-06-19 18:24:24,772 P5019 [INFO] File "manage.py", line 16, in main 2020-06-19 18:24:24,772 P5019 [INFO] ) from exc 2020-06-19 18:24:24,772 P5019 [INFO] ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment? </code></pre> <p>让我相信问题在于我的虚拟环境无法激活。一些在线研究告诉我激活venv的命令应该是</p> <pre><code>opt/python/run/venv/bin/activate </code></pre> <p>我试图通过eb-ssh激活它,但没有成功,我收到了消息</p> <pre><code>bash: opt/python/run/venv/bin/activate: No such file or directory </code></pre> <p>当我检查opt目录时,由于缺少python文件夹,这一点得到了证实。我不知道为什么虚拟环境不存在/无法被激活,如果您能提供帮助,我将不胜感激</p> <p>编辑-目录结构: 父目录-django微博 <a href="https://i.stack.imgur.com/hM7FD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hM7FD.png" alt="enter image description here"/></a></p> <p>.ebextensions- <a href="https://i.stack.imgur.com/Bomgj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Bomgj.png" alt="enter image description here"/></a></p> <p>djangmicroblog- <a href="https://i.stack.imgur.com/maDfL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/maDfL.png" alt="enter image description here"/></a></p> <p>djangoportfolio(本地虚拟文件夹)- <a href="https://i.stack.imgur.com/EXzFw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EXzFw.png" alt="enter image description here"/></a></p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>事实证明,我的应用程序是为amazon linux 1和;二,;环境是AmazonLinux2</p> <p>我不得不将我的环境降级为AL1 python 3.6,并将应用程序中的一些设置还原为AL1(例如wsgi路径)</p> <p>它现在已启动并运行:)</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
区分轴上的像素大小
5 回答
区分过度拟合与良好预测
9 回答
区分通过POST接收的数据并在Cherrypy中获取
3 回答
区分重写和重载
7 回答
区分金贾二号的类型
3 回答
区别:IF IN和IF==python
8 回答
区别:list.append()与incrementequal?
8 回答
区别:创建在启动wx应用程序时不“阻止”控制台的脚本
5 回答
区别于python中的命令行和CGI
1 回答
区别关系
2 回答
区别是什么APIClient.enforce\ csrf\检查以及APIClient.handler.enforce\ csrf\ u检查
6 回答
区块.draw()未在python空闲模式下工作
5 回答
区块链API调用输出对象名称而不是内容
9 回答
区块链nonce值随负载变化
5 回答
区块链Python语法错误(Snakecoin)
7 回答
区块链不连接到服务器和矿工
9 回答
区块链信息钱包支票支付员
1 回答
区块链和区块链密码错误
8 回答
区块链尝试向Transaction字典添加键/值以创建区块链
10 回答
区域:IOError:[Errno 22]无效模式('w')或filenam
8 回答