[英]Installing requirements.txt inside of a folder in a VScode dev container
我正在使用 Microsoft 的 Python 開發容器模板https://github.com/microsoft/vscode-remote-try-python
它正常工作,我對結構進行了一些小改動。 我添加了一個名為“project1”的文件夾並將 requirements.txt 文件移動到該文件夾中。
當我使用此設置更新 .devcontainer 文件時:
{
...
"postCreateCommand": "pip install -r subject-selection/requirements.txt"
...
}
它失敗了,說它找不到文件。 我究竟做錯了什么?
這是文件結構:
.
├── Dockerfile
├── README.md
├── data
└── subject-selection
├── Dataset Analysis.ipynb
├── __pycache__
│ └── analysis_utils.cpython-39.pyc
├── analysis_utils.py
├── download-subjects.py
├── out
├── requirements.txt
└── run-placement-analysis.sh
我相信postCreateCommand
從位置/bin/sh
,所以在你的情況下它正在尋找文件'/bin/sh/subject-selection/requirements.txt'。 你可能想要這樣的東西:
"postCreateCommand": "pip install -r /workspaces/subject-selection/requirements.txt"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.