Help with Orthanc Python

Good morning,
I’ve been using orthanc in an academic environment for about 8 years with a Lua script that Sebastien helped me make.
My script waits for the study to be stable and exports the zipped study to a specific folder.
This month I decided to create a test set for artificial intelligence. To do this, I need to export the studies as a PNG or JPG2000 image as soon as the instance is stable. I would also like to extract the data from the DICOM TAGS and place it in a text file.
I then decided to change the SCRIPT from LUA to PYTHON. However, I couldn’t understand the documentation. I use Linux (Debian and Ubuntu). I was unable to install it because it says it is a controlled environment.
I use the machine just for that. Do I really need to create a VENV or can I force the plugin to be installed using:
sudo pip install --break-system-packages orthanc-python ??
Do I really need to compile the packet with “cmake” ?
Should I keep using LUA instead ?

Hello,

If you install the Orthanc packages for your distribution, there should not be any issue.

If it is not the case, then you need to make sure that Python is installed, and you need to pick the right version of the Python plugin for your (major) Python version.

Your question about the venv would indicate that you require packages out of the standard library?

Please note that the Orthanc Python plugin is not a Python package. It’s a binary package that depends on the Python runtime and is meant to be installed in the Orthanc ecosystem, not in a venv.

You mention that you were unable to install. What are you unable to install, exactly? And what makes you think that --break-system-packages would be required?

More importantly, how is Orthanc installed ?

As a last resort, can you run Docker containers?

With more information on your setup, we might be able to help.

You should definitely stick with Python that is a much more powerful language to develop Orthanc plugins than Lua is.

(If you have sudo access, as your question seems to indicate, the sky is the limit… :slight_smile:)

Benjamin