语境
我正在使用 Elastic Beanstalk 部署一个非常简单的测试应用程序。我有几个要使用 apt 安装的软件包。我01_installations.sh在.platform/hooks/prebuild目录中包含了一个安装脚本。当我压缩我的应用程序并部署到 Elastic Beanstalk 时,日志确认预构建脚本运行,但它没有权限。
2020/08/12 21:03:46.674234 [INFO] Executing instruction: RunAppDeployPreBuildHooks
2020/08/12 21:03:46.674256 [INFO] Executing platform hooks in .platform/hooks/prebuild/
2020/08/12 21:03:46.674296 [INFO] Following platform hooks will be executed in order: [01_installations.sh]
2020/08/12 21:03:46.674302 [INFO] Running platform hook: .platform/hooks/prebuild/01_installations.sh
2020/08/12 21:03:46.674482 [ERROR] An error occurred during execution of command [app-deploy] - [RunAppDeployPreBuildHooks]. Stop running the command. Error: Command .platform/hooks/prebuild/01_installations.sh failed with error fork/exec .platform/hooks/prebuild/01_installations.sh: permission denied
Run Code Online (Sandbox Code Playgroud)
题
我的理解是权限被拒绝,因为我没有添加chmod +x以使 .sh …
问题
\n我正在尝试为包含许多子目录的 Python 项目构建文档。我正在尝试使用sphinx-apidoc以使该过程变得无缝。但是,尽管我尽了最大努力,但我无法处理子目录中的代码。我在这里遵循了 YouTube 上的一个很棒的简短教程,效果很好。为了模拟我遇到的问题,我将其中一个文件放入can_it_handle_folders目录中,如下所示。
spamfilter-py\n\xe2\x94\x82 __init__.py (**)\n\xe2\x94\x82 readme.md\n\xe2\x94\x82 sample.py\n\xe2\x94\x82 spamfilter.py\n\xe2\x94\x82 token.py\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80can_it_handle_folders\n\xe2\x94\x82 __init__.py\n\xe2\x94\x82 test_spamfilter.py\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80docs\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80build\n\xe2\x94\x82 \xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80html\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80source\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80conf.py\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80index.rst\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80modules.rst\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80sample.rst\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80spamfilter.rst\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80token.rst\n\xe2\x94\x82 \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80spamfilter-py.test_spamfilter.rst\n\xe2\x94\x82 \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80html\n...\nRun Code Online (Sandbox Code Playgroud)\n我进入该docs目录并运行sphinx-apidoc -o . ..以根据根spamfilter目录生成 .rst 文件。我已将以下行添加到conf.py:
sys.path.insert(0, os.path.abspath(\'..\'))\nRun Code Online (Sandbox Code Playgroud)\n和我生成的modules.rst看起来像:
spamfilter-py\n=============\n\n.. toctree::\n :maxdepth: 4\n\n sample\n spamfilter\n token\nRun Code Online (Sandbox Code Playgroud)\n目录中任何内容的 html 都can_it_handle_folders不会生成。如果我尝试添加can_it_handle_folders/test_spamfilter到目录树,我会得到一个toctree contains reference to nonexisting document \'can_it_handle_folders/test_spamfilter\' …
问题
我正在尝试使用小型数据库后端在 Elastic Beanstalk 上部署一个非常简单的应用程序。我尝试将安装mysqlclient作为 AWS此处概述的过程的一部分。但是,当我部署我的应用程序时,我从我的 Elastic Beanstalk 日志中收到以下错误,因为它尝试下载包:
Collecting mysqlclient
Using cached mysqlclient-2.0.1.tar.gz (87 kB)
2020/08/21 20:30:16.419082 [ERROR] An error occurred during execution of command [app-deploy] - [InstallDependency]. Stop running the command. Error: fail to install dependencies with requirements.txt file with error Command /bin/sh -c /var/app/venv/staging-LQM1lest/bin/pip install -r requirements.txt failed with error exit status 1. Stderr: ERROR: Command errored out with exit status 1:
command: /var/app/venv/staging-LQM1lest/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bz45889a/mysqlclient/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bz45889a/mysqlclient/setup.py'"'"';f=getattr(tokenize, …Run Code Online (Sandbox Code Playgroud) 我在一台新 Mac 上安装了 Python。我相信我使用 Homebrew 重新安装了 Python。然而,这条路对我来说很不寻常,我想知道为什么它位于这里:
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3
我已经习惯了 Python 像这样的地方(这也是):
/Users/user.name/Library/Python/3.9/bin
第一次安装有什么不同?如果我的Python位于此处,有什么特殊注意事项吗?