节点天蓝色 Web 应用程序上的 conda insatllation

时间:2021-03-25 06:27:38

标签: python node.js azure azure-webapps

我想在 Azure Web 应用程序上部署我的节点项目。我的项目在 index.js 文件上运行 python 脚本作为子进程。我的 python 脚本运行机器学习模型。这是我的 index.js 中的一部分代码。

    fastify.get('/ping', (request, reply) => {
  var pythonProcess = spawn("python", ["main.py"]);
  pythonProcess.stdout.on("data", function (data) {
    var ModalDataInString = data.toString();
    reply.send({ hello: ModalDataInString })
  })
})

所以我的 python 脚本需要一些 conda 安装。所以我需要运行一个 environment.yml 文件。这是我的 environment.yml 文件。

 name: speech-env2
channels:
  - defaults
  - conda-forge
dependencies:
  - python=3.7.6
  - pip
  - pip:
    - pyreadline
    - numpy==1.18.1
    - librosa==0.7.2
    - numba==0.48.0
    - tensorflow==2.2.0
    - pydub==0.24.1
    - textblob==0.15.3
    - ibm_cloud_sdk_core==1.7.3
    - nltk==3.4.5
    - Flask==1.1.1
    - Keras==2.3.1
    - matplotlib==3.1.3
    - ibm_watson==4.7.1
    - Pillow==8.1.0
    - wordcloud==1.8.1
    - PyJWT==1.7.1
    - ffmpeg

我也有requirement.txt文件,但有些包需要通过conda安装。任何人都请告诉我如何在 azure 上创建我的 conda 环境。 如果有人有其他方法可以做到这一点,请告诉我。

0 个答案:

没有答案