简体   繁体   English

找不到 Bitbucket 管道 python3.7! 尝试 pythonBin 选项

[英]Bitbucket pipleline python3.7 not found! Try the pythonBin option

I have below bitbucket pipeline我有以下 bitbucket 管道

    image: node:11.13.0-alpine

pipelines:
  branches:
    master:
      - step:
          caches:
            - node
          script:
            - apk add python py-pip python3
            - npm install -g serverless
            - serverless config credentials --stage dev --provider aws --key $AWS_ACCESS_KEY_ID --secret $AWS_SECRET_ACCESS_KEY
            - cd src/rsc_user
            - pip install -r requirements.txt
            - sls plugin install -n serverless-python-requirements
            - sls plugin install -n serverless-wsgi
            - npm i serverless-package-external --save-dev
            - npm install serverless-domain-manager --save-dev
            - serverless deploy --stage dev
      

Throwing error投掷错误

 Error -------------------------------------------------- Error: python3.7 not found! Try the pythonBin option. at pipAcceptsSystem (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/serverless-python-requirements/lib/pip.js:100:13) at installRequirements (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/serverless-python-requirements/lib/pip.js:173:9) at installRequirementsIfNeeded (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/serverless-python-requirements/lib/pip.js:556:3) at ServerlessPythonRequirements.installAllRequirements (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/serverless-python-requirements/lib/pip.js:635:29) at ServerlessPythonRequirements.tryCatcher (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/opt/atlassian/pipelines/agent/build/src/rsc_user/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:443:21) at process.topLevelDomainCallback (domain.js:136:23) For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable. Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com Your Environment Information --------------------------- Operating System: linux Node Version: 11.13.0 Framework Version: 2.1.1 Plugin Version: 4.0.4 SDK Version: 2.3.2 Components Version: 3.1.4

I am not able to get this error as I am new in python.由于我是 Python 新手,因此无法收到此错误。 any help highly appreciated任何帮助高度赞赏

Thanks谢谢

This error basically means you do not have the right installation of python.这个错误基本上意味着你没有正确安装python。 Some application needs python3.7 and you do not specify a version with apk add python3 .某些应用程序需要 python3.7 并且您没有使用apk add python3指定版本。 Hence, the latest is probably installed (3.8).因此,可能安装了最新版本(3.8)。

This article deals with how to select a given python version for an agent in a bitbucket pipeline. 本文介绍如何为 bitbucket 管道中的代理选择给定的 Python 版本。 It basically boils down to:它基本上归结为:

image: python:3.7
pipelines:
  default:
    - step:
        script:
          - python --version

Is there a reason you have to use Alpine?是否有理由必须使用 Alpine? Otherwise I'd go for the pragmatic image above.否则我会选择上面的务实形象。

he solve with他解决了

pythonRequirements:
   pythonBin: python3

Similar problem类似问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM