Official setup procedure has a part that assumes a Debian-based Linux environment, so the procedure when setting up on macOS Leave
macOS Catalina 10.15.6
Python 3.8.5 on pyenv 1.2.20
Do not use Anaconda
pydicom
$ pip install pydicom
Optional libraries
$ pip install numpy
$ pip install pillow
CharPyLS
$ pip install cython
$ pip install git+https://github.com/Who8MyLunch/CharPyLS
GDCM
A little time-consuming part without Anaconda Refer to Installing the Python GDCM bindings without Conda and write the description for Ubuntu / Debian on macOS. Arrange for
$ brew install gdcm
#Check the location of installed related files
$ find /usr -name gdcm.py
/usr/local/lib/python3.8/site-packages/gdcm.py
/usr/local/Cellar/gdcm/3.0.7_1/lib/python3.8/site-packages/gdcm.py
$ find /usr -name "libgdcmCommon.*"
/usr/local/lib/libgdcmCommon.3.0.dylib
/usr/local/lib/libgdcmCommon.3.0.7.dylib
/usr/local/lib/libgdcmCommon.dylib
/usr/local/Cellar/gdcm/3.0.7_1/lib/libgdcmCommon.3.0.dylib
/usr/local/Cellar/gdcm/3.0.7_1/lib/libgdcmCommon.3.0.7.dylib
/usr/local/Cellar/gdcm/3.0.7_1/lib/libgdcmCommon.dylib
#Copy related files to pyenv environment
$ cd ~/.pyenv/versions/3.8.5/lib/python3.8/site-packages/
$ cp /usr/local/lib/python3.8/site-packages/gdcm.py .
$ cp /usr/local/lib/python3.8/site-packages/gdcmswig.py .
$ cp /usr/local/lib/python3.8/site-packages/_gdcmswig* .
$ cp /usr/local/lib/libgd* .
ʻImport gdcm` on the Python prompt and OK if no error occurs
Recommended Posts