Greetings,
I have been pulling my hair out trying to setup the new Orthanc Mammography plugin on Windows 11. I’m using Python 3.12.
I execute the following commands to set up the Virtual enviroment
D:\orthanc-mammography-master>python -m venv mammovenv
D:\orthanc-mammography-master>cd mammovenv
D:\orthanc-mammography-master\mammovenv>cd scripts
D:\orthanc-mammography-master\mammovenv\Scripts>activate
(mammovenv) D:\orthanc-mammography-master\mammovenv\Scripts>D:\orthanc-mammography-master\mammovenv\Scripts\python.exe -m pip install --upgrade pip
(mammovenv) D:\orthanc-mammography-master\mammovenv\Scripts>cd ..
(mammovenv) D:\orthanc-mammography-master\mammovenv>cd ..
(mammovenv) D:\orthanc-mammography-master>pip install -r requirements.txt
Add the following to my config file
"Plugins" : [ "C:\\Orthanc\\Plugins" ],
"Python" : {
"Path" : "D:\\orthanc-mammography-master\\mammography.py"
},
"Mammography" : {
"VirtualEnv" : "D:\\orthanc-mammography-master\\mammovenv\\Lib\\site-packages"
},
Then end up with the following error in the logs
I0902 14:16:14.035659 MAIN PluginsManager.cpp:316] (plugins) Found a shared library: "C:\Orthanc\Plugins\OrthancPython-Python3.12-4.3.dll"
W0902 14:16:14.063695 MAIN PluginsManager.cpp:274] Registering plugin 'python' (version 4.3)
W0902 14:16:14.065695 MAIN PluginsManager.cpp:158] Python plugin is initializing
W0902 14:16:14.067697 MAIN PluginsManager.cpp:158] Using Python script "mammography.py" from directory: D:\orthanc-mammography-master
W0902 14:16:14.069802 MAIN PluginsManager.cpp:158] Program name: C:\Orthanc\Orthanc.exe
Downloading: https://github.com/jodogne/orthanc-mammography/raw/master/viewer/2024-08-31-StoneWebViewer-DICOM-SR.zip
File already downloaded
I0902 14:16:15.074684 MAIN PluginsManager.cpp:162] (plugins) Registering a Python REST callback on URI: /mammography-viewer/(.*)
I0902 14:16:15.076865 MAIN OrthancPlugins.cpp:2789] (plugins) Plugin has registered a REST callback without mutual exclusion on: /mammography-viewer/(.*)
E0902 14:16:17.053895 MAIN PluginsManager.cpp:154] Error during the installation of the Python script, traceback:
<class 'OSError'>
[WinError 126] The specified module could not be found. Error loading "D:\orthanc-mammography-master\mammovenv\Lib\site-packages\torch\lib\shm.dll" or one of its dependencies.
File "D:\orthanc-mammography-master\mammography.py", line 101, in <module>
import model
File "D:\orthanc-mammography-master\model.py", line 23, in <module>
import torch
File "D:\orthanc-mammography-master\mammovenv\Lib\site-packages\torch\__init__.py", line 141, in <module>
raise err
E0902 14:16:17.064878 MAIN PluginsManager.cpp:92] Error while initializing plugin C:\Orthanc\Plugins\OrthancPython-Python3.12-4.3.dll (code -1)