【发布时间】:2022-01-17 15:17:53
【问题描述】:
我们使用以下配置来旋转集群。它在上周之前一直运行良好,但现在因 error ERROR: Failed cleaning build dir for libcst Failed to build libcst ERROR: Could not build wheels for libcst which use PEP 517 and cannot be installed directly
Building wheels for collected packages: pynacl, libcst
Building wheel for pynacl (PEP 517): started
Building wheel for pynacl (PEP 517): still running...
Building wheel for pynacl (PEP 517): finished with status 'done'
Created wheel for pynacl: filename=PyNaCl-1.5.0-cp37-cp37m-linux_x86_64.whl size=201317 sha256=4e5897bc415a327f6b389b864940a8c1dde9448017a2ce4991517b30996acb71
Stored in directory: /root/.cache/pip/wheels/2f/01/7f/11d382bf954a093a55ed9581fd66c3b45b98769f292367b4d3
Building wheel for libcst (PEP 517): started
Building wheel for libcst (PEP 517): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /opt/conda/anaconda/bin/python /opt/conda/anaconda/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpon3bonqi
cwd: /tmp/pip-install-9ozf4fcp/libcst
集群配置命令:
gcloud dataproc clusters create cluster-test \
--enable-component-gateway \
--region us-east1 \
--zone us-east1-b \
--master-machine-type n1-highmem-32 \
--master-boot-disk-size 500 \
--num-workers 3 \
--worker-machine-type n1-highmem-16 \
--worker-boot-disk-size 500 \
--optional-components ANACONDA,JUPYTER,ZEPPELIN \
--image-version 1.5.54-ubuntu18 \
--tags <tag-name> \
--bucket '<cloud storage bucket>' \
--initialization-actions 'gs://goog-dataproc-initialization-actions-us-east1/connectors/connectors.sh','gs://goog-dataproc-initialization-actions-us-east1/python/pip-install.sh' \
--metadata='PIP_PACKAGES=wheel datalab xgboost==1.3.3 shap oyaml click apache-airflow apache-airflow-providers-google' \
--initialization-action-timeout 30m \
--metadata gcs-connector-version=2.1.1,bigquery-connector-version=1.1.1,spark-bigquery-connector-version=0.17.2 \
--project <project-name>
我尝试过的事情: a) 我尝试将 wheel 包作为 pip 包的一部分显式安装,但问题没有解决
b) 带有升级 pip 脚本的 Gcloud 命令t:
gcloud dataproc clusters create cluster-test \
--enable-component-gateway \
--region us-east1 \
--zone us-east1-b \
--master-machine-type n1-highmem-32 \
--master-boot-disk-size 500 \
--num-workers 3 \
--worker-machine-type n1-highmem-16 \
--worker-boot-disk-size 500 \
--optional-components ANACONDA,JUPYTER,ZEPPELIN \
--image-version 1.5.54-ubuntu18 \
--tags <tag-name> \
--bucket '<cloud storage bucket>' \
--initialization-actions 'gs://goog-dataproc-initialization-actions-us-east1/connectors/connectors.sh','gs://<bucket-path>/upgrade-pip.sh','gs://goog-dataproc-initialization-actions-us-east1/python/pip-install.sh' \
--metadata='PIP_PACKAGES=wheel datalab xgboost==1.3.3 shap oyaml click apache-airflow apache-airflow-providers-google' \
--initialization-action-timeout 30m \
--metadata gcs-connector-version=2.1.1,bigquery-connector-version=1.1.1,spark-bigquery-connector-version=0.17.2 \
--project <project-name>
【问题讨论】:
-
在这里stackoverflow.com/questions/61365790/… 发现了一个类似的问题。尝试升级 pip?
-
@Dagang 感谢您的建议。我已经浏览了该链接,但是我想了解如何在集群创建期间使用初始化脚本升级 pip。您能否强调一下如何做到这一点。我无权访问节点上的 SSH 并手动执行操作
-
在初始化操作中使用
/opt/conda/default/bin/pip install --upgrade pip。 -
@Dagang 我尝试以这种方式在上述集群配置命令中运行自定义初始化脚本(具有 pip 升级命令)
--initialization-actions 'gs://goog-dataproc-initialization-actions-us-east1/connectors/connectors.sh','gs://my-bucket/upgrade-pip.sh' \upgrade-pip.sh 文件内容为:!/bin/bash pip install --upgrade pip。所以你建议使用/opt/conda/default/bin/pip install --upgrade pip而不是pip install --upgrade pip。 -
@Dagang 所以你建议使用
/opt/conda/default/bin/pip install --upgrade pip而不是pip install --upgrade pip,因为我正在创建一个自定义图像,其中Anaconda作为我的python 解释器
标签: python-3.x pip airflow google-cloud-dataproc python-wheel