问题
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:
- clear my py enviroment: here
- install x86 GDCM: here (current is GDCM-2.8.4-Windows-x86.exe)
- copy '_gdcmswig.pyd, gdcm.py, gdcmswig.py' to 'C:\Python27\DLLs'
来源:https://stackoverflow.com/questions/49297078/how-to-install-gdcm-python-wrapping-on-windows-system