2

i coded a python script in pycharm as "probe.py" and later built the executable(.exe) file out of it using the mentioned code in setup.py file but the exe file thus created shows error on opening as import error mising required dependency['numpy'] even when it is present in my project.

error image

enter image description here

  import sys

  from cx_Freeze import setup,Executable


  include_files = ['autorun.inf']
  base = None

  if sys.platform == "win32":
  base = "Win32GUI"

  setup(name="Probe",version="0.1",description="fun",
  options={'build_exe':{'include_files': include_files}},
  executables=[Executable("probe.py",base=base)])

`

5
  • what is you error? can you post that as well? Commented Jun 12, 2018 at 12:39
  • Possible duplicate of Creating cx_Freeze exe with Numpy for Python Commented Jun 12, 2018 at 12:41
  • @Nihal I added a picture as a description of the error dialog. Thanks! Commented Jun 12, 2018 at 12:45
  • Please, never post pictures unless it is a GUI issue, copy and paste the text of the error into your question. Commented Jun 12, 2018 at 12:46
  • how can you copy paste windows error popup message? Commented Jun 12, 2018 at 12:48

2 Answers 2

1
from cx_Freeze import setup, Executable
   base = None
   if sys.platform == "win32":
     base = "Win32GUI"
   build_exe_options = {"packages": ["numpy"],
     include_files = ['autorun.inf']}

   setup(
        name = "Probe",
        version = "0.1",
        description = "fun",
        options = {"build_exe": build_exe_options},
        executables = [Executable("probe.py",base=base)]
        )

run this script tell me if there is a problem

Sign up to request clarification or add additional context in comments.

1 Comment

glad to help mate
0

According to cx_Freeze documentation, try adding build_exe with a packages key.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.