【问题标题】:Unable to import numpy, DLL load failed: The specified module could not be found无法导入numpy,DLL加载失败:找不到指定的模块
【发布时间】:2019-12-17 14:47:21
【问题描述】:

我构建了一个使用 pandas 的 tkinter 应用程序,并且可执行文件在我的计算机和具有 anaconda env 的计算机上运行良好,但每次我尝试在没有 python 的计算机上运行时都会出现以下错误。

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 = '<any description>',
    executables = executables
)

i tried this solution with no sucess

【问题讨论】:

    标签: pandas numpy cx-freeze


    【解决方案1】:

    看起来你有多个 NumPy 版本。 做 - pip3卸载numpy - 重复直到没有更多的numpy。 然后 - pip install numpy - 这应该解决它

    【讨论】:

      猜你喜欢
      • 2020-04-18
      • 2023-03-05
      • 1970-01-01
      • 2022-06-21
      • 2017-11-23
      • 2020-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多