pydicom / pynetdicom

A Python implementation of the DICOM networking protocol
https://pydicom.github.io/pynetdicom
MIT License
500 stars 176 forks source link

ModuleNotFoundError: No module named 'pynetdicom.apps.movescu.echoscp' #950

Closed davidrs06 closed 1 month ago

davidrs06 commented 1 month ago

Hi all,

I think there might be an issue with the installation of the movescuscript. I created a conda environment with only python=3.12, and ran pip install pydicom as well as pip install pynetdicom. When running movescu I get the following error:

Traceback (most recent call last):
  File "~/miniconda3/envs/pydicom_env/bin/movescu", line 5, in <module>
    from pynetdicom.apps.movescu.echoscp import main
ModuleNotFoundError: No module named 'pynetdicom.apps.movescu.echoscp'`

When opening the file ~/miniconda3/envs/pydicom_env/bin/movescu, the file content is:

#!/~/miniconda3/envs/pacs2bids/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from pynetdicom.apps.movescu.echoscp import main
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

It looks like it's trying to import from an echoscp file in the movescu folder, which doesn't exist in the current version of pynetdicom. I think it might be related to the script installation used here: https://github.com/pydicom/pynetdicom/blob/1d0b1df63037b04f01b9951cabc9d4e6fa602e6d/pyproject.toml#L76C1-L76C8. Could replace pynetdicom.apps.movescu.echoscp:main by pynetdicom.apps.movescu.movescu:main solve the issue ?

scaramallion commented 1 month ago

Ah, yes you're right. I'm tempted to blame poetry for this but the typo is all mine.