Python runtime creation error - ResolvePackageNotFound


#1

I need to create a python runtime.

To make sure package dependency works, I created a new conda env locally and installed packages with versions I want. (numpy=1.9.3, conda.pandas=0.23.1). It works. I then created the package.json file as

{
  "name": "XXX",
  "description": "XXX",
  "dependencies": [
    "standardDependencies"
  ],
  "runtimes": {
    "py-ABC": {
      "language": "Python",
      "runtime": "CPython",
      "modules": {
        "conda.numpy": "=1.9.3",
        "conda.pandas": "=0.23.1"
      }
    }
  }
}

When I try to run a function with annotation @py(env="ABC"), I got the following error really quickly:

"Failed during the creation of ActionRuntime 'Obj<ActionRuntime> [,]', a_step='environment creation', a_error='c3.love.exceptions.C3RuntimeException: Error executing command: /usr/local/share/c3/conda/bin/conda env create -p /usr/local/share/c3/condaEnvs/f35/prod/py-mdf -q --file /tmp/1786f388-ae40-41ae-b5e3-19b0ca99bed3/requirements.yaml
ResolvePackageNotFound: 
  - pandas 0.23.1*'"

Why is this?


#2

From @Phoebus

Another path for investigation is to check which conda channel has pandas 0.23.1 . You may need to explicitly add the conda channel where you expect to find that package in the “repositories” field of a runtime, e.g.:

{
  "name": "XXX",
  "description": "XXX",
  "dependencies": [
    "standardDependencies"
  ],
  "runtimes": {
    "py-ABC": {
      "language": "Python",
      "runtime": "CPython",
      "modules": {
        "conda.numpy": "=1.9.3",
        "conda.pandas": "=0.23.1"
      },
      "repositories": [
        "https://repo.continuum.io/pkgs/main",
        "conda-forge"
      ]
    }
  }
}