在构建 gitpod 工作区时遇到错误,而我也在 pip3 之前尝试过使用 pip。遇到同样的问题。
.gitpod.dockerfile
FROM gitpod/workspace-full
RUN pyenv install 3.10.7 \
&& pyenv global 3.10.7
RUN pip3 install --upgrade pip && \
pip3 install -I dbt-core==1.8.2 \
pip3 install -I dbt-postgres==1.8.2 \
pip3 install -I elementary-data==0.15.1 \
pip3 install -I recce==0.24.0 \
pip3 install -I sqlfluff==3.0.7 \
pip3 install -I sqlfluff-templater-dbt==3.0.7
...rest of the
错误
Collecting dbt-core==1.8.2
4.050 Downloading dbt_core-1.8.2-py3-none-any.whl.metadata (3.9 kB)
4.123 ERROR: Could not find a version that satisfies the requirement pip3 (from versions: none)
4.153 ERROR: No matching distribution found for pip3
------
.gitpod.dockerfile:6
--------------------
5 |
6 | >>> RUN pip3 install --upgrade pip && \
7 | >>> pip3 install -I dbt-core==1.8.2 \
8 | >>> pip3 install -I dbt-postgres==1.8.2 \
9 | >>> pip3 install -I elementary-data==0.15.1 \
10 | >>> pip3 install -I recce==0.24.0 \
11 | >>> pip3 install -I sqlfluff==3.0.7 \
12 | >>> pip3 install -I sqlfluff-templater-dbt==3.0.7
13 |
--------------------
error: failed to solve: process "/bin/sh -c pip3 install --upgrade pip && pip3 install -I dbt-core==1.8.2 pip3 install -I dbt-postgres==1.8.2 pip3 install -I elementary-data==0.15.1 pip3 install -I recce==0.24.0 pip3 install -I sqlfluff==3.0.7 pip3 install -I sqlfluff-templater-dbt==3.0.7" did not complete successfully: exit code: 1
{"@type":"type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent","command":"build","error":"exit status 1","file":"build.go:44","func":"func1","level":"error","message":"build failed","serviceContext":{"service":"bob","version":""},"severity":"ERROR","time":"2024-09-30T10:45:50.779922528Z"}
exit
🍊 This task ran as a workspace prebuild
⏱️ Well done on saving 6 minutes
我试图用这些代码片段设置 gitpod,但遇到了上面提到的问题
您在该命令中缺少一些
&&
。
RUN pip3 install --upgrade pip && \
pip3 install -I dbt-core==1.8.2 && \
pip3 install -I dbt-postgres==1.8.2 && \
#(... etc ...)
否则,该命令将被解释为
pip3 install --upgrade pip
pip3 install -I dbt-core==1.8.2 pip3 install -I dbt-postgres==1.8.2
# (...etc...)
– 因此
pip
抱怨它找不到要安装的名为 pip3
的软件包(或者,随后安装名为 install
的软件包...)。
但是,最好在一次
pip3 install
调用中安装所有可以安装的内容:
RUN pip3 install --upgrade pip && \
pip3 install -I dbt-core==1.8.2 dbt-postgres==1.8.2 \
#(... etc ...)