Getting No module named 'requests' with jodogne/orthanc-python

392 Views Asked by At

I am trying to extend the orthanc server with few custom code refering to https://book.orthanc-server.com/plugins/python.html#auto-routing-studies . I am having my custom code written into python script and its getting picked up aswell. The issue is as mentioned in the document when i try to use requests module with the latest jodogne/orthanc-python image it gives me ModuleNotFoundError .

I tried installing requests library separately but its not getting picked up by my code.

Any help would really be appreciated.

2

There are 2 best solutions below

0
On

First you need to install the requests library with pip, then you have to import requests inside your Python script.

0
On

I also encountered issues when using the latest jodogne/orthanc-python image. I built a version that is able to use pip install. You can try out the Dockerfile below:

FROM j3soon/orthanc-python:1.9.6
RUN apt-get update && apt-get install -y python3-pip
RUN python3.7 -m pip install requests

Alternatively, launch j3soon/orthanc-python:1.9.6 directly and run the commands above.