1

After reading this:https://github.com/neurosnap/mudicom/blob/master/docs/install.rst

Download from here:https://github.com/malaterre/GDCM/releases install it and

Copy the gdcm.py&gdcmswig.py to site-packages folder, run this sample code: https://pypi.python.org/pypi/mudicom

Errors:

File "C:\Python27\lib\site-packages\gdcmswig.py", line 119
    def value(self) -> "PyObject *":
                    ^
SyntaxError: invalid syntax

Then I found here: Problems with new module in Python (x,y) 2.7

But I want to use in py2.7 version, any suggestions?


after I move to python 3.6, install all packages, error:

File "D:/Projects/py3test/BackendTest.py", line 15, in import mudicom

File "D:\Projects\py3test\venv\lib\site-packages\mudicom__init__.py", line 15, in from .base import Dicom

File "D:\Projects\py3test\venv\lib\site-packages\mudicom\base.py", line 11, in import gdcm

File "D:\Projects\py3test\venv\lib\site-packages\gdcm.py", line 68, in from gdcmswig import *

File "D:\Projects\py3test\venv\lib\site-packages\gdcmswig.py", line 20, in _gdcmswig = swig_import_helper()

File "D:\Projects\py3test\venv\lib\site-packages\gdcmswig.py", line 19, in swig_import_helper return importlib.import_module(mname)

File "C:\Users\summy\AppData\Local\Programs\Python\Python36- 32\Lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level)

ImportError: DLL load failed: %1 is not a valid Win32 application.

any suggestions? thank you!! system: windows 10 Home edition x64 IDE: Pycharm


I finally solved this problem:

  1. clear my py enviroment: here
  2. install x86 GDCM: here (current is GDCM-2.8.4-Windows-x86.exe)
  3. copy '_gdcmswig.pyd, gdcm.py, gdcmswig.py' to 'C:\Python27\DLLs'
Kamil
  • 594
  • 1
  • 8
  • 28
  • You have only 2 options: use Python 3 or backport it to Python 2. You may try to remove all type annotations but there are no guaranties there are no other constructs incompatible with Python 2. Which one is the smart option is a good question but off-topic here. – Paulo Scardine Mar 15 '18 at 13:41
  • @PauloScardine hi, I change to python3 a new error describe as above – Kamil Mar 16 '18 at 02:51

0 Answers0