CX_Freeze可执行文件提供“无法加载文件系统编解码器”错误

我正在尝试获取一个hello世界程序来处理cx_freeze。 它的build设很好,但我得到错误,当我运行该exe文件:

Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings' 

我的Python脚本:

 if __name__ == '__main__': print('Hello World.') 

和我的cx_freeze设置文件:

 import sys from cx_Freeze import setup, Executable exe = Executable( script="py_helloWorld.py" ) setup( name = "helloWorld", version = "0.1", description = "Hello World on command prompt .exe from cx_freeze", executables = [exe] ) 

当我运行:

 py cx_setup.py build 

我得到:

 running build running build_exe copying C:\AD-install\virtualenvs\cx_freeze_env\lib\site-packages\cx_Freeze\bases\Console.exe -> build\exe.win32-3.5\py_helloWorld.exe copying C:\AD-install\virtualenvs\cx_freeze_env\Scripts\python35.dll -> build\exe.win32-3.5\python35.dll *** WARNING *** unable to create version resource install pywin32 extensions first writing zip file build\exe.win32-3.5\libs\python35.zip Name File ---- ---- m BUILD_CONSTANTS m __future__ C:\AD-install\virtualenvs\cx_freeze_env\lib\__future__.py m __startup__ C:\AD-install\virtualenvs\cx_freeze_env\lib\site-packages\cx_Freeze\initscripts\__startup__.py m _ast m _bootlocale C:\AD-install\virtualenvs\cx_freeze_env\lib\_bootlocale.py m _bz2 C:\Python35\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 C:\AD-install\virtualenvs\cx_freeze_env\lib\_collections_abc.py m _compression C:\Python35\Lib\_compression.py m _datetime m _dummy_thread C:\AD-install\virtualenvs\cx_freeze_env\lib\_dummy_thread.py m _functools m _hashlib C:\Python35\DLLs\_hashlib.pyd m _heapq m _imp m _io m _locale m _lzma C:\Python35\DLLs\_lzma.pyd m _md5 m _multibytecodec m _opcode m _operator m _random m _sha1 m _sha256 m _sha512 m _signal m _socket C:\Python35\DLLs\_socket.pyd m _sre m _ssl C:\Python35\DLLs\_ssl.pyd m _stat m _string m _strptime C:\Python35\Lib\_strptime.py m _struct m _thread m _threading_local C:\Python35\Lib\_threading_local.py m _warnings m _weakref m _weakrefset C:\AD-install\virtualenvs\cx_freeze_env\lib\_weakrefset.py m _winapi m abc C:\AD-install\virtualenvs\cx_freeze_env\lib\abc.py m argparse C:\Python35\Lib\argparse.py m ast C:\Python35\Lib\ast.py m atexit m base64 C:\AD-install\virtualenvs\cx_freeze_env\lib\base64.py m bdb C:\Python35\Lib\bdb.py m binascii m builtins m bz2 C:\Python35\Lib\bz2.py m calendar C:\Python35\Lib\calendar.py m cmd C:\Python35\Lib\cmd.py m code C:\Python35\Lib\code.py m codecs C:\AD-install\virtualenvs\cx_freeze_env\lib\codecs.py m codeop C:\Python35\Lib\codeop.py P collections C:\AD-install\virtualenvs\cx_freeze_env\lib\collections\__init__.py m collections.abc C:\AD-install\virtualenvs\cx_freeze_env\lib\collections\abc.py m contextlib C:\Python35\Lib\contextlib.py m copy C:\AD-install\virtualenvs\cx_freeze_env\lib\copy.py m copyreg C:\AD-install\virtualenvs\cx_freeze_env\lib\copyreg.py m datetime C:\Python35\Lib\datetime.py m difflib C:\Python35\Lib\difflib.py m dis C:\Python35\Lib\dis.py m doctest C:\Python35\Lib\doctest.py m dummy_threading C:\Python35\Lib\dummy_threading.py P email C:\Python35\Lib\email\__init__.py m email._encoded_words C:\Python35\Lib\email\_encoded_words.py m email._header_value_parser C:\Python35\Lib\email\_header_value_parser.py m email._parseaddr C:\Python35\Lib\email\_parseaddr.py m email._policybase C:\Python35\Lib\email\_policybase.py m email.base64mime C:\Python35\Lib\email\base64mime.py m email.charset C:\Python35\Lib\email\charset.py m email.contentmanager C:\Python35\Lib\email\contentmanager.py m email.encoders C:\Python35\Lib\email\encoders.py m email.errors C:\Python35\Lib\email\errors.py m email.feedparser C:\Python35\Lib\email\feedparser.py m email.generator C:\Python35\Lib\email\generator.py m email.header C:\Python35\Lib\email\header.py m email.headerregistry C:\Python35\Lib\email\headerregistry.py m email.iterators C:\Python35\Lib\email\iterators.py m email.message C:\Python35\Lib\email\message.py m email.parser C:\Python35\Lib\email\parser.py m email.policy C:\Python35\Lib\email\policy.py m email.quoprimime C:\Python35\Lib\email\quoprimime.py m email.utils C:\Python35\Lib\email\utils.py P encodings C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\__init__.py m encodings.aliases C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\aliases.py m encodings.ascii C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\ascii.py m encodings.base64_codec C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\base64_codec.py m encodings.big5 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\big5.py m encodings.big5hkscs C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\big5hkscs.py m encodings.bz2_codec C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\bz2_codec.py m encodings.charmap C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\charmap.py m encodings.cp037 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp037.py m encodings.cp1006 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1006.py m encodings.cp1026 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1026.py m encodings.cp1125 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1125.py m encodings.cp1140 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1140.py m encodings.cp1250 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1250.py m encodings.cp1251 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1251.py m encodings.cp1252 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1252.py m encodings.cp1253 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1253.py m encodings.cp1254 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1254.py m encodings.cp1255 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1255.py m encodings.cp1256 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1256.py m encodings.cp1257 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1257.py m encodings.cp1258 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp1258.py m encodings.cp273 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp273.py m encodings.cp424 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp424.py m encodings.cp437 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp437.py m encodings.cp500 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp500.py m encodings.cp65001 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp65001.py m encodings.cp720 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp720.py m encodings.cp737 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp737.py m encodings.cp775 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp775.py m encodings.cp850 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp850.py m encodings.cp852 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp852.py m encodings.cp855 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp855.py m encodings.cp856 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp856.py m encodings.cp857 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp857.py m encodings.cp858 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp858.py m encodings.cp860 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp860.py m encodings.cp861 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp861.py m encodings.cp862 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp862.py m encodings.cp863 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp863.py m encodings.cp864 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp864.py m encodings.cp865 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp865.py m encodings.cp866 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp866.py m encodings.cp869 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp869.py m encodings.cp874 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp874.py m encodings.cp875 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp875.py m encodings.cp932 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp932.py m encodings.cp949 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp949.py m encodings.cp950 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\cp950.py m encodings.euc_jis_2004 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\euc_jis_2004.py m encodings.euc_jisx0213 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\euc_jisx0213.py m encodings.euc_jp C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\euc_jp.py m encodings.euc_kr C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\euc_kr.py m encodings.gb18030 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\gb18030.py m encodings.gb2312 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\gb2312.py m encodings.gbk C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\gbk.py m encodings.hex_codec C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\hex_codec.py m encodings.hp_roman8 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\hp_roman8.py m encodings.hz C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\hz.py m encodings.idna C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\idna.py m encodings.iso2022_jp C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso2022_jp.py m encodings.iso2022_jp_1 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso2022_jp_1.py m encodings.iso2022_jp_2 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso2022_jp_2.py m encodings.iso2022_jp_2004 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso2022_jp_2004.py m encodings.iso2022_jp_3 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso2022_jp_3.py m encodings.iso2022_jp_ext C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso2022_jp_ext.py m encodings.iso2022_kr C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso2022_kr.py m encodings.iso8859_1 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_1.py m encodings.iso8859_10 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_10.py m encodings.iso8859_11 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_11.py m encodings.iso8859_13 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_13.py m encodings.iso8859_14 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_14.py m encodings.iso8859_15 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_15.py m encodings.iso8859_16 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_16.py m encodings.iso8859_2 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_2.py m encodings.iso8859_3 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_3.py m encodings.iso8859_4 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_4.py m encodings.iso8859_5 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_5.py m encodings.iso8859_6 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_6.py m encodings.iso8859_7 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_7.py m encodings.iso8859_8 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_8.py m encodings.iso8859_9 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\iso8859_9.py m encodings.johab C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\johab.py m encodings.koi8_r C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\koi8_r.py m encodings.koi8_t C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\koi8_t.py m encodings.koi8_u C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\koi8_u.py m encodings.kz1048 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\kz1048.py m encodings.latin_1 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\latin_1.py m encodings.mac_arabic C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_arabic.py m encodings.mac_centeuro C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_centeuro.py m encodings.mac_croatian C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_croatian.py m encodings.mac_cyrillic C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_cyrillic.py m encodings.mac_farsi C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_farsi.py m encodings.mac_greek C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_greek.py m encodings.mac_iceland C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_iceland.py m encodings.mac_latin2 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_latin2.py m encodings.mac_roman C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_roman.py m encodings.mac_romanian C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_romanian.py m encodings.mac_turkish C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mac_turkish.py m encodings.mbcs C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\mbcs.py m encodings.palmos C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\palmos.py m encodings.ptcp154 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\ptcp154.py m encodings.punycode C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\punycode.py m encodings.quopri_codec C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\quopri_codec.py m encodings.raw_unicode_escape C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\raw_unicode_escape.py m encodings.rot_13 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\rot_13.py m encodings.shift_jis C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\shift_jis.py m encodings.shift_jis_2004 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\shift_jis_2004.py m encodings.shift_jisx0213 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\shift_jisx0213.py m encodings.tis_620 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\tis_620.py m encodings.undefined C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\undefined.py m encodings.unicode_escape C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\unicode_escape.py m encodings.unicode_internal C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\unicode_internal.py m encodings.utf_16 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_16.py m encodings.utf_16_be C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_16_be.py m encodings.utf_16_le C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_16_le.py m encodings.utf_32 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_32.py m encodings.utf_32_be C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_32_be.py m encodings.utf_32_le C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_32_le.py m encodings.utf_7 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_7.py m encodings.utf_8 C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_8.py m encodings.utf_8_sig C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\utf_8_sig.py m encodings.uu_codec C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\uu_codec.py m encodings.zlib_codec C:\AD-install\virtualenvs\cx_freeze_env\lib\encodings\zlib_codec.py m enum C:\Python35\Lib\enum.py m errno m fnmatch C:\AD-install\virtualenvs\cx_freeze_env\lib\fnmatch.py m functools C:\AD-install\virtualenvs\cx_freeze_env\lib\functools.py m gc m genericpath C:\AD-install\virtualenvs\cx_freeze_env\lib\genericpath.py m getopt C:\Python35\Lib\getopt.py m gettext C:\Python35\Lib\gettext.py m glob C:\Python35\Lib\glob.py m gzip C:\Python35\Lib\gzip.py m hashlib C:\AD-install\virtualenvs\cx_freeze_env\lib\hashlib.py m heapq C:\AD-install\virtualenvs\cx_freeze_env\lib\heapq.py P html C:\Python35\Lib\html\__init__.py m html.entities C:\Python35\Lib\html\entities.py P http C:\Python35\Lib\http\__init__.py m http.client C:\Python35\Lib\http\client.py m http.server C:\Python35\Lib\http\server.py m imp C:\AD-install\virtualenvs\cx_freeze_env\lib\imp.py P importlib C:\AD-install\virtualenvs\cx_freeze_env\lib\importlib\__init__.py m importlib._bootstrap C:\AD-install\virtualenvs\cx_freeze_env\lib\importlib\_bootstrap.py m importlib._bootstrap_external C:\AD-install\virtualenvs\cx_freeze_env\lib\importlib\_bootstrap_external.py m importlib.abc C:\AD-install\virtualenvs\cx_freeze_env\lib\importlib\abc.py m importlib.machinery C:\AD-install\virtualenvs\cx_freeze_env\lib\importlib\machinery.py m importlib.util C:\AD-install\virtualenvs\cx_freeze_env\lib\importlib\util.py m inspect C:\Python35\Lib\inspect.py m io C:\AD-install\virtualenvs\cx_freeze_env\lib\io.py m ipaddress C:\Python35\Lib\ipaddress.py m itertools m keyword C:\AD-install\virtualenvs\cx_freeze_env\lib\keyword.py m linecache C:\AD-install\virtualenvs\cx_freeze_env\lib\linecache.py m locale C:\AD-install\virtualenvs\cx_freeze_env\lib\locale.py P logging C:\Python35\Lib\logging\__init__.py m lzma C:\Python35\Lib\lzma.py m marshal m math m mimetypes C:\Python35\Lib\mimetypes.py m msvcrt m nt m ntpath C:\AD-install\virtualenvs\cx_freeze_env\lib\ntpath.py m opcode C:\Python35\Lib\opcode.py m operator C:\AD-install\virtualenvs\cx_freeze_env\lib\operator.py m optparse C:\Python35\Lib\optparse.py m os C:\AD-install\virtualenvs\cx_freeze_env\lib\os.py m pdb C:\Python35\Lib\pdb.py m pkgutil C:\Python35\Lib\pkgutil.py m platform C:\Python35\Lib\platform.py m plistlib C:\Python35\Lib\plistlib.py m posixpath C:\AD-install\virtualenvs\cx_freeze_env\lib\posixpath.py m pprint C:\Python35\Lib\pprint.py m py_compile C:\Python35\Lib\py_compile.py m py_helloworld__init__ C:\AD-install\virtualenvs\cx_freeze_env\lib\site-packages\cx_Freeze\initscripts\Console.py m py_helloworld__main__ py_helloWorld.py m pydoc C:\Python35\Lib\pydoc.py P pydoc_data C:\Python35\Lib\pydoc_data\__init__.py m pydoc_data.topics C:\Python35\Lib\pydoc_data\topics.py m pyexpat C:\Python35\DLLs\pyexpat.pyd m quopri C:\Python35\Lib\quopri.py m random C:\AD-install\virtualenvs\cx_freeze_env\lib\random.py m re C:\AD-install\virtualenvs\cx_freeze_env\lib\re.py m reprlib C:\AD-install\virtualenvs\cx_freeze_env\lib\reprlib.py m select C:\Python35\DLLs\select.pyd m selectors C:\Python35\Lib\selectors.py m shlex C:\Python35\Lib\shlex.py m shutil C:\AD-install\virtualenvs\cx_freeze_env\lib\shutil.py m signal C:\Python35\Lib\signal.py m socket C:\Python35\Lib\socket.py m socketserver C:\Python35\Lib\socketserver.py m sre_compile C:\AD-install\virtualenvs\cx_freeze_env\lib\sre_compile.py m sre_constants C:\AD-install\virtualenvs\cx_freeze_env\lib\sre_constants.py m sre_parse C:\AD-install\virtualenvs\cx_freeze_env\lib\sre_parse.py m ssl C:\Python35\Lib\ssl.py m stat C:\AD-install\virtualenvs\cx_freeze_env\lib\stat.py m string C:\Python35\Lib\string.py m stringprep C:\Python35\Lib\stringprep.py m struct C:\AD-install\virtualenvs\cx_freeze_env\lib\struct.py m subprocess C:\Python35\Lib\subprocess.py m sys m tarfile C:\AD-install\virtualenvs\cx_freeze_env\lib\tarfile.py m tempfile C:\AD-install\virtualenvs\cx_freeze_env\lib\tempfile.py m textwrap C:\Python35\Lib\textwrap.py m threading C:\Python35\Lib\threading.py m time m token C:\AD-install\virtualenvs\cx_freeze_env\lib\token.py m tokenize C:\AD-install\virtualenvs\cx_freeze_env\lib\tokenize.py m traceback C:\Python35\Lib\traceback.py m tty C:\Python35\Lib\tty.py m types C:\AD-install\virtualenvs\cx_freeze_env\lib\types.py m unicodedata C:\Python35\DLLs\unicodedata.pyd P unittest C:\Python35\Lib\unittest\__init__.py m unittest.case C:\Python35\Lib\unittest\case.py m unittest.loader C:\Python35\Lib\unittest\loader.py m unittest.main C:\Python35\Lib\unittest\main.py m unittest.result C:\Python35\Lib\unittest\result.py m unittest.runner C:\Python35\Lib\unittest\runner.py m unittest.signals C:\Python35\Lib\unittest\signals.py m unittest.suite C:\Python35\Lib\unittest\suite.py m unittest.util C:\Python35\Lib\unittest\util.py P urllib C:\Python35\Lib\urllib\__init__.py m urllib.parse C:\Python35\Lib\urllib\parse.py m uu C:\Python35\Lib\uu.py m warnings C:\AD-install\virtualenvs\cx_freeze_env\lib\warnings.py m weakref C:\AD-install\virtualenvs\cx_freeze_env\lib\weakref.py m webbrowser C:\Python35\Lib\webbrowser.py m winreg P xml C:\Python35\Lib\xml\__init__.py P xml.parsers C:\Python35\Lib\xml\parsers\__init__.py m xml.parsers.expat C:\Python35\Lib\xml\parsers\expat.py m zipfile C:\Python35\Lib\zipfile.py m zipimport m zlib Missing modules: ? __main__ imported from bdb, pdb ? _dummy_threading imported from dummy_threading ? _frozen_importlib imported from importlib, importlib.abc ? _frozen_importlib_external imported from importlib, importlib._bootstrap, importlib.abc ? _posixsubprocess imported from subprocess ? _winreg imported from platform ? ce imported from os ? grp imported from shutil, tarfile ? java.lang imported from platform ? org.python.core imported from copy ? os.path imported from os, pkgutil, py_compile, unittest, unittest.util ? posix imported from os ? pwd imported from http.server, posixpath, shutil, tarfile, webbrowser ? termios imported from tty ? vms_lib imported from platform This is not necessarily a problem - the modules may not be needed on this platform. copying C:\Python35\DLLs\_bz2.pyd -> build\exe.win32-3.5\libs\_bz2.pyd copying C:\Python35\DLLs\_hashlib.pyd -> build\exe.win32-3.5\libs\_hashlib.pyd copying C:\Python35\DLLs\_lzma.pyd -> build\exe.win32-3.5\libs\_lzma.pyd copying C:\Python35\DLLs\_socket.pyd -> build\exe.win32-3.5\libs\_socket.pyd copying C:\Python35\DLLs\_ssl.pyd -> build\exe.win32-3.5\libs\_ssl.pyd copying C:\Python35\DLLs\pyexpat.pyd -> build\exe.win32-3.5\libs\pyexpat.pyd copying C:\Python35\DLLs\select.pyd -> build\exe.win32-3.5\libs\select.pyd copying C:\Python35\DLLs\unicodedata.pyd -> build\exe.win32-3.5\libs\unicodedata.pyd 

然后从命令行调用构build的exe文件(无论是在virtualenv中还是在virtualenv中):

 Fatal Python error: Py_Initialize: unable to load the file system codec ImportError: No module named 'encodings' Current thread 0x00001cec (most recent call first): 

我在64位机器的Windows 10上运行Python 3.5(32位版本)。 我正在运行一个virtualenv与以下内容:

 appdirs (1.4.3) cx-Freeze (5.0.1) et-xmlfile (1.0.1) jdcal (1.3) numpy (1.12.1+mkl) opencv-python (3.2.0+contrib) openpyxl (2.4.7) packaging (16.8) pip (9.0.1) pyparsing (2.2.0) setuptools (35.0.2) six (1.10.0) wheel (0.29.0) 

我究竟做错了什么? 我search了很长一段时间,没有论坛或教程解决这个问题(我迄今为止发现)。

Solutions Collecting From Web of "CX_Freeze可执行文件提供“无法加载文件系统编解码器”错误"