That's my first question here, but that won't be the first time Stack Overflow save me !
I am using conda on a windows10 machine and created my env with tensorflow 2.0 When I tried to add pydicom (v1.4 from condaforge) there was an issue with tensorflow 2.0 : conda wanted to downgrade tf to an 1.x version.
Today I tried to create a new env with :
conda create -n DICOM_TF
conda install pydicom=1.3
conda update python=3.7
conda install pydot
conda install nibabel
conda install pytables
conda install -c https://conda.anaconda.org/simpleitk SimpleITK
conda install nipype
conda install pandas
conda install tensorflow=2.1
Pydicom is installed, I tried the 1.3 and the 1.4 versions of pydicom. I can find it with an anaconda prompt
(base) PS C:\Users\alexa> conda activate DICOM_TF
(DICOM_TF) PS C:\Users\alexa> conda list
# packages in environment at C:\Users\alexa\.conda\envs\DICOM_TF:
#
# Name Version Build Channel
_tflow_select 2.2.0 eigen
absl-py 0.9.0 py37_0
asn1crypto 1.3.0 py37_0
astor 0.8.0 py37_0
blas 1.0 mkl
blinker 1.4 py37_0
blosc 1.16.3 h7bd577a_0
bzip2 1.0.8 he774522_0
ca-certificates 2020.1.1 0
cachetools 3.1.1 py_0
certifi 2019.11.28 py37_0
cffi 1.14.0 py37h7a1dbc1_0
chardet 3.0.4 py37_1003
click 7.0 py37_0
cryptography 2.8 py37h7a1dbc1_0
cycler 0.10.0 py37_0
decorator 4.4.1 py_0
etelemetry 0.1.2 py_1 conda-forge
filelock 3.0.12 py_0
freetype 2.9.1 ha9979f8_1
gast 0.2.2 py37_0
google-auth 1.11.2 py_0
google-auth-oauthlib 0.4.1 py_2
google-pasta 0.1.8 py_0
graphviz 2.38 hfd603c8_2
grpcio 1.27.2 py37h351948d_0
h5py 2.10.0 py37h5e291fa_0
hdf5 1.10.4 h7ebc959_0
html5lib 1.0.1 py37_0
icc_rt 2019.0.0 h0cc432a_1
icu 58.2 ha66f8fd_1
idna 2.8 py37_0
intel-openmp 2020.0 166
isodate 0.6.0 py_1
joblib 0.14.1 py_0
jpeg 9b hb83a4c4_2
keepalive 0.5 py_1 conda-forge
keras-applications 1.0.8 py_0
keras-preprocessing 1.1.0 py_1
kiwisolver 1.1.0 py37ha925a31_0
libiconv 1.15 h1df5818_7
libpng 1.6.37 h2a8f88b_0
libprotobuf 3.11.4 h7bd577a_0
libtiff 4.1.0 h56a325e_0
libxml2 2.9.9 h464c3ec_0
libxslt 1.1.33 h579f668_0
lxml 4.5.0 py37h1350720_0
lz4-c 1.8.1.2 h2fa13f4_0
lzo 2.10 h6df0209_2
markdown 3.1.1 py37_0
matplotlib 3.1.3 py37_0
matplotlib-base 3.1.3 py37h64f37c6_0
mkl 2020.0 166
mkl-service 2.3.0 py37hb782905_0
mkl_fft 1.0.15 py37h14836fe_0
mkl_random 1.1.0 py37h675688f_0
mock 4.0.1 py_0
networkx 2.4 py_0
neurdflib 5.0.1 py_0 conda-forge
nibabel 3.0.1 py_0 conda-forge
nilearn 0.6.1 pyh5ca1d4c_1 conda-forge
nipype 1.4.2 py37_0 conda-forge
numexpr 2.7.1 py37h25d0782_0
numpy 1.18.1 py37h93ca92e_0
numpy-base 1.18.1 py37hc3f5095_1
oauthlib 3.1.0 py_0
olefile 0.46 py37_0
openssl 1.1.1d he774522_4
opt_einsum 3.1.0 py_0
packaging 20.1 py_0
pandas 1.0.1 py37h47e9c7a_0
pillow 7.0.0 py37hcc1f983_0
pip 20.0.2 py37_1
protobuf 3.11.4 py37h33f27b4_0
prov 1.5.3 py_1 conda-forge
psutil 5.6.7 py37he774522_0
pyasn1 0.4.8 py_0
pyasn1-modules 0.2.7 py_0
pycparser 2.19 py37_0
pydicom 1.3.0 py_0 conda-forge
pydot 1.4.1 py37_0
pydotplus 2.0.2 py37_1
pyjwt 1.7.1 py37_0
pyopenssl 19.1.0 py37_0
pyparsing 2.4.6 py_0
pyqt 5.9.2 py37h6538335_2
pyreadline 2.1 py37_1
pysocks 1.7.1 py37_0
pytables 3.6.1 py37h1da0976_0
python 3.7.6 h60c2a47_2
python-dateutil 2.8.1 py_0
pytz 2019.3 py_0
pywin32 227 py37he774522_1
qt 5.9.7 vc14h73c81de_0
rdflib 4.2.2 py37_1000 conda-forge
requests 2.22.0 py37_1
requests-oauthlib 1.3.0 py_0
rsa 4.0 py_0
scikit-learn 0.22.1 py37h6288b17_0
scipy 1.4.1 py37h9439919_0
setuptools 45.2.0 py37_0
simpleitk 1.2.4 py37ha925a31_0 simpleitk
simplejson 3.17.0 py37he774522_0
sip 4.19.8 py37h6538335_0
six 1.14.0 py37_0
snappy 1.1.7 h777316e_3
sparqlwrapper 1.8.2 py37_1000 conda-forge
sqlite 3.31.1 he774522_0
tensorboard 2.1.0 py3_0
tensorflow 2.1.0 eigen_py37hd727fc0_0
tensorflow-base 2.1.0 eigen_py37h49b2757_0
tensorflow-estimator 2.1.0 pyhd54b08b_0
termcolor 1.1.0 py37_1
tk 8.6.8 hfa6e2cd_0
tornado 6.0.3 py37he774522_3
traits 5.2.0 py37he774522_0
urllib3 1.25.8 py37_0
vc 14.1 h0510ff6_4
vs2015_runtime 14.16.27012 hf0eaf9b_1
webencodings 0.5.1 py37_1
werkzeug 0.14.1 py37_0
wheel 0.34.2 py37_0
win_inet_pton 1.1.0 py37_0
wincertstore 0.2 py37_0
wrapt 1.11.2 py37he774522_0
xz 5.2.4 h2fa13f4_4
zlib 1.2.11 h62dcd97_3
zstd 1.3.7 h508b16e_0
(DICOM_TF) PS C:\Users\alexa>
But when I run some code in jupyter notebook I can't import pydicom (neither dicom which was the name for pydicom versions <1.0)
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-aa8631cee69b> in <module>
1 import matplotlib.pyplot as plt
2 import numpy as np
----> 3 import pydicom as dicom
4 import os
5 import pandas
ModuleNotFoundError: No module named 'pydicom'
But the module is installed and works if I open python in the anaconda prompt :
(DICOM_TF) PS C:\Users\alexa> python
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydicom
>>> exemple= pydicom.dcmread(r"J:\ExportODIASP1\Optima\Export_2020-01-31_15-38-39\10000000\10000001\10000086\100000A6",force =True,specific_tags =["ImagePositionPatient"])
>>> if (0x20, 0x32) in exemple:
... position1 = exemple["ImagePositionPatient"].value
...
>>> print(position1)
['-165.629', '-379.095', '88.125']
>>>
DO you have any solution to use pydicom and tf2.1 in the same environment ?
Thank you for your help :) Have a nice day, Alex