1

Problem: I get the error "ModuleNotFoundError: No module named 'pydicom'" when trying to run an executable created from a python program using cx_Freeze.

Background: I am using Python 3.8 with Anaconda 2020.02 on Windows 10 with PyCharm 2019.3.3 Community Edition as an editor, cx_Freeeze version 6.2, pydicom version 2.00. I am new to Python programming.

I had some initial trouble installing pydicom (pydicom-2.0.0-pyh9f0ad1d_0) and needed to go through the Anaconda Navigator to get it installed properly. Pydicom is not included with the standard package apparently.

Attempted: There are a lot of posts describing similar problems. I tried the following code for my setup.py but still no luck


from cx_Freeze import setup, Executable

packages = ['pydicom']
include_files = ["C:/<me>/.conda/pkgs/pydicom-2.0.0-pyh9f0ad1d_0/site-packages/pydicom"]

setup(name="MyProgram",
      options={"build.exe": {'packages':packages, 'include_files':include_files}},
      executables = [Executable("MyProgram.py")])

I fooled around with the include_files variable (e.g., ""C://.conda/pkgs/pydicom-2.0.0-pyh9f0ad1d_0/site-packages") with no luck.

I also use pandas in this code but there are no complaints when running (maybe it failed before executing any pandas code?)

Any suggestions welcome!

Thanks,

Tom

0 Answers0