解决docker安装pip问题
This commit is contained in:
@@ -29,7 +29,8 @@ COPY schoolNewsCrawler/ /app/crawler/
|
||||
RUN cd /app/crawler && \
|
||||
if [ -f requirements.txt ]; then \
|
||||
echo "安装爬虫依赖..."; \
|
||||
python3 -m pip install --no-cache-dir -r requirements.txt; \
|
||||
# Python 3.12 引入了 PEP 668 规范,默认禁止在系统环境直接使用 pip 安装包,防止破坏系统 Python 环境。
|
||||
python3 -m pip install --no-cache-dir --break-system-packages -r requirements.txt; \
|
||||
else \
|
||||
echo "警告: 未找到requirements.txt文件"; \
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user