server icon indicating copy to clipboard operation
server copied to clipboard

pb_stub.cc:257] Failed to initialize Python stub for auto-complete: ModuleNotFoundError: No module named 'PIL' for 23.10

Open anshudaur opened this issue 1 year ago • 4 comments

Description


Python version is 3.9
Failed to initialize Python stub for auto-complete: ModuleNotFoundError: No module named 'PIL'

At:
  /models/detic_general_preprocess_v1/1/model.py(5): <module>
  <frozen importlib._bootstrap>(241): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(883): exec_module
  <frozen importlib._bootstrap>(703): _load_unlocked
  <frozen importlib._bootstrap>(1006): _find_and_load_unlocked
  <frozen importlib._bootstrap>(1027): _find_and_load

Triton Information What version of Triton are you using? 23.10

Are you using the Triton container or did you build it yourself? Using triton container - nvcr.io/nvidia/tritonserver:23.10-py3

To Reproduce Steps to reproduce the behavior.

Describe the models (framework, inputs, outputs), ideally include the model configuration file (if using an ensemble include the model configuration file for that as well). Preprocessing config for the ensemble model :

backend: "python"

input [
  {
    name: "image_bytes"
    data_type: TYPE_STRING
    dims: [1]
  }
]

output [
  {
    name: "image_shape"
    data_type: TYPE_INT32
    dims: [2] # height, width
  },
  {
    name: "images__0"
    data_type: TYPE_FP32
    dims: [3, 896, 896]
  },
  {
    name: "model_threshold"
    data_type: TYPE_FP32
    dims: [1]
  }
]
instance_group [
    {
      count: 1
      kind: KIND_GPU
    }
  ]
parameters: {
  key: "EXECUTION_ENV_PATH",
  value: {string_value: "$$TRITON_MODEL_DIRECTORY/pyenv.tar.gz"}
}

Expected behavior A clear and concise description of what you expected to happen.

The error is occurring for Pillow library which already exists . I have also tried setting 'export PYTHONNOUSERSITE=True' and rebuild the environment but the error still occurs.

Let me know how to fix it.

Best, Anshu

anshudaur avatar Nov 21 '23 10:11 anshudaur

The issue was related to python 3.1 files, to fix it the above error follow the below steps :

conda create --name pyenv python=3.10
export PYTHONNOUSERSITE=True
conda install -y conda-pack==0.7.0
conda-pack -f --ignore-missing-files --exclude lib/python3.1

anshudaur avatar Nov 21 '23 13:11 anshudaur

Hi, I saw you reopened this issue. Are you still facing problems or were you able to solve this? We're facing a similar issue and could really gain help from your progress.

pmubeen avatar Apr 16 '24 13:04 pmubeen

@pmubeen sadly, i am still facing this issue.

anshudaur avatar Apr 16 '24 14:04 anshudaur

@anshudaur check this issue for more details. I believe this should unblock you as well.

jadhosn avatar Apr 22 '24 21:04 jadhosn