- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
这与 cx_freeze error with pyodbc 几乎完全相同除了添加小数作为特定包含不起作用:卡住正常,但是当尝试运行可执行文件时,我得到:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27
, in <module>
exec(code, m.__dict__)
File "my_program.py", line 9, in <module>
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2214, in _find_a
nd_load
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 2203, in _find_a
nd_load_unlocked
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1191, in _load_u
nlocked
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1161, in _load_b
ackward_compatible
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 539, in _check_n
ame_wrapper
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 1692, in load_mo
dule
File "c:\python\32-bit\3.4\lib\importlib\_bootstrap.py", line 321, in _call_wi
th_frames_removed
RuntimeError: Unable to import decimal
当我添加十进制作为包含时,我看到输出文件夹中包含 _decimal.pyd
,但仍然出现相同的运行时错误。
这是我的 setup.py:
import sys
from cx_Freeze import setup, Executable
build_exe_options = {
'includes': ['decimal'],
'include_files': ['connection settings.cfg']
}
setup(name = 'my_program',
version = '0.0.1',
description = """This program does stuff.""",
options = {'build_exe':build_exe_options},
executables = [Executable('my_program.py')]
)
我正在使用:
更新:这是构建时的输出:
C:\Users\my_name\Documents\Python>python my_program.py build
running build
running build_exe
creating directory build\exe.win32-3.4
copying C:\Python34\lib\site-packages\cx_Freeze\bases\Console.exe -> build\exe.w
in32-3.4\my_program.exe
copying C:\Windows\system32\python34.dll -> build\exe.win32-3.4\python34.dll
*** WARNING *** unable to create version resource
install pywin32 extensions first
writing zip file build\exe.win32-3.4\library.zip
Name File
---- ----
m BUILD_CONSTANTS
m ConfigParser C:\Python34\lib\ConfigParser.py
m __future__ C:\Python34\lib\__future__.py
m _ast
m _bisect
m _bootlocale
m _bz2 C:\Python34\DLLs\_bz2.pyd
m _codecs
m _codecs_cn
m _codecs_hk
m _codecs_iso2022
m _codecs_jp
m _codecs_kr
m _codecs_tw
m _collections
m _collections_abc
m _datetime
m _decimal C:\Python34\DLLs\_decimal.pyd
m _dummy_thread
m _functools
m _hashlib C:\Python34\DLLs\_hashlib.pyd
m _heapq
m _imp
m _io
m _locale
m _lzma C:\Python34\DLLs\_lzma.pyd
m _md5
m _multibytecodec
m _opcode
m _operator
m _osx_support C:\Python34\lib\_osx_support.py
m _random
m _sha1
m _sha256
m _sha512
m _socket C:\Python34\DLLs\_socket.pyd
m _sre
m _ssl C:\Python34\DLLs\_ssl.pyd
m _stat
m _string
m _strptime
m _struct
m _thread
m _threading_local
m _warnings
m _weakref
m _weakrefset
m _winapi
m abc
m argparse
m array
m ast C:\Python34\lib\ast.py
m atexit
m base64
m bdb C:\Python34\lib\bdb.py
m binascii
m bisect C:\Python34\lib\bisect.py
m builtins
m bz2
m calendar
m cmd C:\Python34\lib\cmd.py
m code C:\Python34\lib\code.py
m codecs
m codeop C:\Python34\lib\codeop.py
P collections
m collections.abc
m configparser C:\Python34\lib\configparser.py
m contextlib
m copy
m copyreg
m cx_Freeze__init__ C:\Python34\lib\site-packages\cx_Freeze\initscripts\
Console.py
m datetime
m decimal C:\Python34\lib\decimal.py
m difflib C:\Python34\lib\difflib.py
m dis C:\Python34\lib\dis.py
P distutils C:\Python34\lib\distutils\__init__.py
m distutils.debug C:\Python34\lib\distutils\debug.py
m distutils.errors C:\Python34\lib\distutils\errors.py
m distutils.log C:\Python34\lib\distutils\log.py
m distutils.spawn C:\Python34\lib\distutils\spawn.py
m distutils.sysconfig C:\Python34\lib\distutils\sysconfig.py
m distutils.text_file C:\Python34\lib\distutils\text_file.py
m doctest C:\Python34\lib\doctest.py
m dummy_threading
P email C:\Python34\lib\email\__init__.py
m email._encoded_words C:\Python34\lib\email\_encoded_words.py
m email._header_value_parser C:\Python34\lib\email\_header_value_parser.py
m email._parseaddr C:\Python34\lib\email\_parseaddr.py
m email._policybase C:\Python34\lib\email\_policybase.py
m email.base64mime C:\Python34\lib\email\base64mime.py
m email.charset C:\Python34\lib\email\charset.py
m email.contentmanager C:\Python34\lib\email\contentmanager.py
m email.encoders C:\Python34\lib\email\encoders.py
m email.errors C:\Python34\lib\email\errors.py
m email.feedparser C:\Python34\lib\email\feedparser.py
m email.generator C:\Python34\lib\email\generator.py
m email.header C:\Python34\lib\email\header.py
m email.headerregistry C:\Python34\lib\email\headerregistry.py
m email.iterators C:\Python34\lib\email\iterators.py
m email.message C:\Python34\lib\email\message.py
m email.parser C:\Python34\lib\email\parser.py
m email.policy C:\Python34\lib\email\policy.py
m email.quoprimime C:\Python34\lib\email\quoprimime.py
m email.utils C:\Python34\lib\email\utils.py
P encodings
m encodings.aliases
m encodings.ascii
m encodings.base64_codec
m encodings.big5
m encodings.big5hkscs
m encodings.bz2_codec
m encodings.charmap
m encodings.cp037
m encodings.cp1006
m encodings.cp1026
m encodings.cp1125
m encodings.cp1140
m encodings.cp1250
m encodings.cp1251
m encodings.cp1252
m encodings.cp1253
m encodings.cp1254
m encodings.cp1255
m encodings.cp1256
m encodings.cp1257
m encodings.cp1258
m encodings.cp273
m encodings.cp424
m encodings.cp437
m encodings.cp500
m encodings.cp65001
m encodings.cp720
m encodings.cp737
m encodings.cp775
m encodings.cp850
m encodings.cp852
m encodings.cp855
m encodings.cp856
m encodings.cp857
m encodings.cp858
m encodings.cp860
m encodings.cp861
m encodings.cp862
m encodings.cp863
m encodings.cp864
m encodings.cp865
m encodings.cp866
m encodings.cp869
m encodings.cp874
m encodings.cp875
m encodings.cp932
m encodings.cp949
m encodings.cp950
m encodings.euc_jis_2004
m encodings.euc_jisx0213
m encodings.euc_jp
m encodings.euc_kr
m encodings.gb18030
m encodings.gb2312
m encodings.gbk
m encodings.hex_codec
m encodings.hp_roman8
m encodings.hz
m encodings.idna
m encodings.iso2022_jp
m encodings.iso2022_jp_1
m encodings.iso2022_jp_2
m encodings.iso2022_jp_2004
m encodings.iso2022_jp_3
m encodings.iso2022_jp_ext
m encodings.iso2022_kr
m encodings.iso8859_1
m encodings.iso8859_10
m encodings.iso8859_11
m encodings.iso8859_13
m encodings.iso8859_14
m encodings.iso8859_15
m encodings.iso8859_16
m encodings.iso8859_2
m encodings.iso8859_3
m encodings.iso8859_4
m encodings.iso8859_5
m encodings.iso8859_6
m encodings.iso8859_7
m encodings.iso8859_8
m encodings.iso8859_9
m encodings.johab
m encodings.koi8_r
m encodings.koi8_u
m encodings.latin_1
m encodings.mac_arabic
m encodings.mac_centeuro
m encodings.mac_croatian
m encodings.mac_cyrillic
m encodings.mac_farsi
m encodings.mac_greek
m encodings.mac_iceland
m encodings.mac_latin2
m encodings.mac_roman
m encodings.mac_romanian
m encodings.mac_turkish
m encodings.mbcs
m encodings.palmos
m encodings.ptcp154
m encodings.punycode
m encodings.quopri_codec
m encodings.raw_unicode_escape
m encodings.rot_13
m encodings.shift_jis
m encodings.shift_jis_2004
m encodings.shift_jisx0213
m encodings.tis_620
m encodings.undefined
m encodings.unicode_escape
m encodings.unicode_internal
m encodings.utf_16
m encodings.utf_16_be
m encodings.utf_16_le
m encodings.utf_32
m encodings.utf_32_be
m encodings.utf_32_le
m encodings.utf_7
m encodings.utf_8
m encodings.utf_8_sig
m encodings.uu_codec
m encodings.zlib_codec
m enum C:\Python34\lib\enum.py
m errno
m fnmatch C:\Python34\lib\fnmatch.py
m ftplib C:\Python34\lib\ftplib.py
m functools
m gc
m genericpath
m getopt C:\Python34\lib\getopt.py
m getpass C:\Python34\lib\getpass.py
m gettext
m glob C:\Python34\lib\glob.py
m gzip C:\Python34\lib\gzip.py
m hashlib C:\Python34\lib\hashlib.py
m heapq
P html C:\Python34\lib\html\__init__.py
m html.entities C:\Python34\lib\html\entities.py
P http C:\Python34\lib\http\__init__.py
m http.client C:\Python34\lib\http\client.py
m http.cookiejar C:\Python34\lib\http\cookiejar.py
m http.server C:\Python34\lib\http\server.py
m imp C:\Python34\lib\imp.py
P importlib C:\Python34\lib\importlib\__init__.py
P importlib C:\Python34\lib\importlib\__init__.py
m importlib._bootstrap
m importlib._bootstrap C:\Python34\lib\importlib\_bootstrap.py
m importlib.machinery C:\Python34\lib\importlib\machinery.py
m importlib.util C:\Python34\lib\importlib\util.py
m inspect C:\Python34\lib\inspect.py
m io
m itertools
m keyword
m linecache
m locale
P logging C:\Python34\lib\logging\__init__.py
m lzma C:\Python34\lib\lzma.py
m my_program__main__ my_program.py
m marshal
m math
m mimetypes C:\Users\clee\Documents\Python\mimetypes.py
m msvcrt
m nt
m ntpath
m nturl2path C:\Python34\lib\nturl2path.py
m numbers C:\Python34\lib\numbers.py
m opcode C:\Python34\lib\opcode.py
m operator
m optparse
m os
m pdb C:\Python34\lib\pdb.py
m pkgutil C:\Python34\lib\pkgutil.py
m platform C:\Python34\lib\platform.py
m plistlib C:\Python34\lib\plistlib.py
m posixpath
m pprint C:\Python34\lib\pprint.py
m py_compile C:\Python34\lib\py_compile.py
m pydoc C:\Python34\lib\pydoc.py
P pydoc_data C:\Python34\lib\pydoc_data\__init__.py
m pydoc_data.topics C:\Python34\lib\pydoc_data\topics.py
m pyexpat C:\Python34\DLLs\pyexpat.pyd
m pyodbc C:\Python34\lib\site-packages\pyodbc-3.0.7-py3.4-win
32.egg\pyodbc.pyd
m quopri
m random C:\Python34\lib\random.py
m re
m reprlib
m select C:\Python34\DLLs\select.pyd
m selectors C:\Python34\lib\selectors.py
m shlex C:\Python34\lib\shlex.py
m shutil C:\Python34\lib\shutil.py
m signal
m socket C:\Python34\lib\socket.py
m socketserver C:\Python34\lib\socketserver.py
m sre_compile
m sre_constants
m sre_parse
m ssl C:\Python34\lib\ssl.py
m stat
m string
m stringprep
m struct
m subprocess C:\Python34\lib\subprocess.py
m sys
m tarfile C:\Python34\lib\tarfile.py
m tempfile C:\Python34\lib\tempfile.py
m textwrap
m threading
m time
m token
m tokenize
m traceback
m tty C:\Python34\lib\tty.py
m types
m unicodedata C:\Python34\DLLs\unicodedata.pyd
P unittest C:\Python34\lib\unittest\__init__.py
m unittest.case C:\Python34\lib\unittest\case.py
m unittest.loader C:\Python34\lib\unittest\loader.py
m unittest.main C:\Python34\lib\unittest\main.py
m unittest.result C:\Python34\lib\unittest\result.py
m unittest.runner C:\Python34\lib\unittest\runner.py
m unittest.signals C:\Python34\lib\unittest\signals.py
m unittest.suite C:\Python34\lib\unittest\suite.py
m unittest.util C:\Python34\lib\unittest\util.py
P urllib C:\Python34\lib\urllib\__init__.py
m urllib.error C:\Python34\lib\urllib\error.py
m urllib.parse C:\Python34\lib\urllib\parse.py
m urllib.request C:\Python34\lib\urllib\request.py
m urllib.response C:\Python34\lib\urllib\response.py
m uu C:\Python34\lib\uu.py
m warnings
m weakref
m webbrowser C:\Python34\lib\webbrowser.py
m winreg
P xml C:\Python34\lib\xml\__init__.py
P xml.dom C:\Python34\lib\xml\dom\__init__.py
m xml.dom.NodeFilter C:\Python34\lib\xml\dom\NodeFilter.py
m xml.dom.domreg C:\Python34\lib\xml\dom\domreg.py
m xml.dom.expatbuilder C:\Python34\lib\xml\dom\expatbuilder.py
m xml.dom.minicompat C:\Python34\lib\xml\dom\minicompat.py
m xml.dom.minidom C:\Python34\lib\xml\dom\minidom.py
m xml.dom.pulldom C:\Python34\lib\xml\dom\pulldom.py
m xml.dom.xmlbuilder C:\Python34\lib\xml\dom\xmlbuilder.py
P xml.parsers C:\Python34\lib\xml\parsers\__init__.py
m xml.parsers.expat C:\Python34\lib\xml\parsers\expat.py
P xml.sax C:\Python34\lib\xml\sax\__init__.py
m xml.sax._exceptions C:\Python34\lib\xml\sax\_exceptions.py
m xml.sax.expatreader C:\Python34\lib\xml\sax\expatreader.py
m xml.sax.handler C:\Python34\lib\xml\sax\handler.py
m xml.sax.saxutils C:\Python34\lib\xml\sax\saxutils.py
m xml.sax.xmlreader C:\Python34\lib\xml\sax\xmlreader.py
m zipfile C:\Python34\lib\zipfile.py
m zipimport
m zlib
Missing modules:
? __main__ imported from bdb, pdb
? _dummy_threading imported from dummy_threading
? _posixsubprocess imported from subprocess
? _scproxy imported from urllib.request
? ce imported from os
? grp imported from shutil, tarfile
? java.lang imported from platform, xml.sax._exceptions
? org.python.core imported from copy, xml.sax
? os.path imported from os, pkgutil, py_compile, shutil, unittest.util
? posix imported from os
? pwd imported from getpass, http.server, posixpath, shutil, tarfile, webbrowser
? termios imported from getpass, tty
? vms_lib imported from platform
? win32api imported from platform
? win32con imported from platform
This is not necessarily a problem - the modules may not be needed on this platfo
rm.
C:\Python34\lib\site-packages\cx_Freeze\freezer.py:574: UserWarning: Duplicate n
ame: 'importlib/__init__.pyc'
outFile.writestr(zinfo, data)
copying C:\Python34\DLLs\_bz2.pyd -> build\exe.win32-3.4\_bz2.pyd
copying C:\Python34\DLLs\_decimal.pyd -> build\exe.win32-3.4\_decimal.pyd
copying C:\Python34\DLLs\_hashlib.pyd -> build\exe.win32-3.4\_hashlib.pyd
copying C:\Python34\DLLs\_lzma.pyd -> build\exe.win32-3.4\_lzma.pyd
copying C:\Python34\DLLs\_socket.pyd -> build\exe.win32-3.4\_socket.pyd
copying C:\Python34\DLLs\_ssl.pyd -> build\exe.win32-3.4\_ssl.pyd
copying C:\Python34\DLLs\pyexpat.pyd -> build\exe.win32-3.4\pyexpat.pyd
copying C:\Python34\lib\site-packages\pyodbc-3.0.7-py3.4-win32.egg\pyodbc.pyd ->
build\exe.win32-3.4\pyodbc.pyd
copying C:\Python34\DLLs\select.pyd -> build\exe.win32-3.4\select.pyd
copying C:\Python34\DLLs\unicodedata.pyd -> build\exe.win32-3.4\unicodedata.pyd
copying connection settings.cfg -> build\exe.win32-3.4\connection settings.cfg
最佳答案
我在非常相似的设置中遇到了同样的问题,唯一可以使其工作的方法是将 importdecimal 添加到我的 python 脚本中,尝试将 importdecimal 添加到 my_program.py
关于python - pyodbc python 3.4 出现 cx_freeze 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25559947/
我正在尝试编译一个 python 程序,我使用的是 python 3.2。所以我下载了 cx_freeze 并安装了它。当我尝试在 cmd 中运行 setup.py 时,它说: "importerro
我正在尝试将我的 python 3.4 程序转换为 exe 以供分发。我尝试使用 cx_Freeze 来做到这一点。但是,当我使用此 setup.py 运行 python setup.py build
我在使用 cx_Freeze-5.0.1-cp36-cp36m-win32.whl 将 python 3.6 编译为 exe 时遇到问题,请帮助我。 我已经从http://www.lfd.uci.ed
比方说 numpy_example.py是: import numpy as np a = np.array([1, 2, 3]) print(a) 使用 Python 2.7.9,使用 cxFree
我正在使用 python 3.7 和 cx_Freeze 5.1.1 ,我试图将我的 python 脚本转换为可执行文件,但我遇到了丢失模块错误,我被难住了。 我尝试将模块放入包中并包含安装脚本,但没
我正在尝试为 Python 3.3 安装 cx_Freeze。但是,在编译源代码时出现此错误 gcc -pthread build/temp.linux-i686-3.3/source/bases/C
tss.py --> 该文件包含一个打开另一个 python 文件 (dark.py) 的子进程 import subprocess as sp def process(): programN
所以我的 python 脚本依赖于我创建的另一个模块。该模块读取文本文件。当我从源代码运行并且一切正常时,脚本、模块和它读取的文件通常位于同一目录中。 我用cx_freeze编译,当我运行它时,导入的
我有一个应用程序,可以在运行时将一些内容打印到控制台。但作为独立的可执行文件不会在控制台上打印任何内容? setup.py 脚本如下所示: import sys from cx_Freeze impo
我尝试将我的(正常工作的)python 3.6 tkinter gui 应用程序构建为 Windows 可执行文件。经过几个小时的尝试,出现了一个错误(有一些名称和 dll 问题),我让它运行了。但它
目前我正在使用 pyinstaller 来捆绑我的 python 应用程序。我同样迁移到 pyGObject(由于 pygtk 被折旧)。 现在 pyinstaller 不支持 pyGObject 并
我正在使用 cx_freeze 模块来创建安装程序和可执行文件。这似乎工作正常,但在运行可执行文件时,我收到以下错误和回溯。 D:\>"app.exe" Traceback (most recent
我可以使用 cx_freeze 来打包我的 python 工具,但是无法加载我需要的库。由于某种原因,输出的可执行文件/二进制名称不断包含在路径中。 我收到以下错误: OSError:/home/de
我正在尝试从 python 脚本(使用大量鸡蛋)构建可执行文件(适用于 32 位 Windows xp) 我考虑过 py2exe(0.6.9)、PyInstaller (1.4) 和 cx_Freez
您好,我尝试在我的 Linux 上安装 cx_Freeze,但我无法安装。我想安装它以将我的 python 应用程序 (.py) 转换为可执行应用程序。 我从这个网站下载资源:https://sour
我选择尝试使用 cx_freeze,它将我的简单 python 3.x 键盘记录器转换为 exe。我选择 cx_freeze 因为 py2exe 只是 python 2.x 我正在使用这个 setup
Adter 使用 cx-freeze python 3.6 创建一个 exe,在 Windows 中工作正常,但在 Linux 中它运行无限次而不停止,即使我只输入 print('hello word
我制作了一个程序,它使用 os.startfile() 启动另一个 python 程序。 我想把它作为两个 exe 文件,通过使用 subprocess.call() 启动第二个文件,在 1 个构建文
我目前正在尝试制作 cx_freeze在我必须使用的 Solaris 工作站上工作,以便从我拥有的 Python 脚本生成可执行文件。问题是,我不是这台机器的管理员,安装cx_freeze请求写入站点
我在将内容包含到我的 cx_Freeze 脚本中时遇到了这个问题,我试图做的是包含 easygui 和 sys,因为我在我的程序中使用它们。任何帮助将不胜感激! 代码如下: import sys fr
我是一名优秀的程序员,十分优秀!