Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import numpy, DLL load failed: The specified module could not be found #541

Closed
wallacez1 opened this issue Dec 17, 2019 · 6 comments

Comments

@wallacez1
Copy link

wallacez1 commented Dec 17, 2019

i builded a tkinter app where i use pandas and the executable runs fine on my computer and in computers with anaconda env but everytime i try to run on computers without python i get the following error.

image

my setup.py

` from cx_Freeze import setup, Executable
import os.path
import sys
import nltk
import numpy

nltk.download('punkt', download_dir='nltk_packages')

PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.file))

os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')

base = None

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

executables = [Executable("main.py", base=base)]

packages = ['sqlalchemy.dialects','sqlalchemy.sql.default_comparator','numpy']
options = {
'build_exe': {
'packages':packages,
"includes": ["numpy","numpy.core._methods"],
'include_files':['nltk_packages','stemmedStop.csv','stemmedWhite.csv',os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll') ]},

}

setup(
name = "Carrefour Nlc",
options = options,
version = "0.0.1",
description = '',
executables = executables
)

`
i already tried this solution with no sucess #205 , i appreciate any help.

Enviroment:
Python: 3.7.5
cx_Freeze:6.0
pandas:0.25.3
numpy: 1.17.4

@wallacez1 wallacez1 changed the title Unamble to import numpy, DLL load failed: The specified module could not be found Unable to import numpy, DLL load failed: The specified module could not be found Dec 17, 2019
@marcelotduarte
Copy link
Owner

What solution you tried? You referenced your issue....
With anaconda, some dlls is in diferent path, and are not copied (issue #526)
Can you try with official python, downloading from python.org?

@wallacez1
Copy link
Author

wallacez1 commented Dec 17, 2019

What solution you tried? You referenced your issue....
With anaconda, some dlls is in diferent path, and are not copied (issue #526)
Can you try with official python, downloading from python.org?

thank you marcelo for your time, already fixed the referenced issue and yes i will try with oficial python

@marcelotduarte
Copy link
Owner

Please report if you have success.

@wallacez1
Copy link
Author

Please report if you have success.

Thank you, the idea of running with official python worked!! but i had to add a new DLL, 'libffi-7.dll' to my setup.py

`from cx_Freeze import setup, Executable
import os.path
import sys
import nltk
nltk.download('punkt', download_dir='nltk_packages')

PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.file))
print(PYTHON_INSTALL_DIR)
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')

base = None

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

executables = [Executable("main.py", base=base)]

packages = ['sqlalchemy.dialects','sqlalchemy.sql.default_comparator']
options = {
'build_exe': {
'packages':packages,
'include_files':['nltk_packages','stemmedStop.csv','stemmedWhite.csv',os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'libffi-7.dll')]},

}

setup(
name = "Carrefour Nlc",
options = options,
version = "0.0.1",
description = '',
executables = executables
)`

Python: 3.8.0
cx_Freeze: 6.1
numpy:1.17.4
pandas:0.25.3

@marcelotduarte
Copy link
Owner

With python 3.7.5 it will work.
In py38 has an issue #523

@marcelotduarte
Copy link
Owner

cx_Freeze 6.1 has just been released.
Assuming this has been resolved.
If you had issues please re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants