PyInstaller 로 Python 코드 를 하나의 독립 된 exe 실행 파일 로 포장 합 니 다.
또 어떤 사람 이 python 이 exe 로 열 렸 다 는 문 제 를 제기 하 는 것 을 보 았 다.
지금 이라도 해 보 려 고요.
주:이 곳 의 모든 블 로그 ToWordpress 를 선택 한 것 은 이 python 스 크 립 트 가 복잡 하고 의존 하 는 모듈 이 많 기 때 문 입 니 다.
이것 이 다 해결 되면 다른 하나의 python 파일 과 작은 python 프로젝트 의 포장 은 더욱 문제 가 되 지 않 습 니 다.
1.먼저 찾 아 보 자.현재 주류 에 몇 가지 방법 이 있 는 지.
몇 개의 이름 을 찾 았 다
cx_Freeze
PyInstaller
py2exe
2.py2exe 와 PyInstaller 에 관 한 두 가지 홈 페이지:
http://www.py2exe.org/index.cgi/FAQ
화해시키다
http://www.pyinstaller.org/
비교 해 보 니 후자 가 더 좋 은 것 같다.
py2exe 에 다른 라 이브 러 리 파일 이 필요 할 것 같 아서 요.너무 자질구레 해 요.
그리고 PyInstaller:
아이콘
그 러 니까 일단 PyInstaller 부터 해 봐.
3.홈 페이지 에서
http://www.pyinstaller.org/
zip 패키지 다운로드:
https://github.com/downloads/pyinstaller/pyinstaller/pyinstaller-2.0.zip
3M+의 pyinstaller-2.0.zip 를 받 아 압축 을 풀 고 cmd 를 열 고 해당 디 렉 터 리 에 들 어가 설치 한 결과 지원 되 지 않 는 다 고 합 니 다.
D:\tmp\dev_tools\python\to_exe\PyInstaller\pyinstaller-2.0>setup.py install
setup.py is not yet supposed to work. Please Use PyInstaller without installation.
그 러 니까 됐어 요.홈 페이지 문 서 를 참고 해서 조금씩 괴 롭 히 세 요.
4.온라인 문서 참조:
http://www.pyinstaller.org/export/v2.0/project/doc/Manual.html?format=raw
결국 필요 하 다 고 했 어 요PyWin32그래서 이 걸 먼저 담아 야 돼 요.
5.알 고 보 니 이미 설치 되 어 있 었 다.
[해 결 됨]Python 에서 오류 발생:ImportError:No module named win32com.client
그러나 주의해 야 할 것 은 import 는 pywin 32 가 아니 라 win32com 입 니 다.
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pywin32
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pywin32
>>> import win32com
>>>
6.계속 참고:Installing PyInstaller
발견,압축 을 풀 면 설 치 된 셈 이다.
7.한 폴 더 에 Python 프로그램 을 준비 합 니 다.
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress
후 용 에 대비 하 다.
8.pyinstaller.py 가 있 는 디 렉 터 리 로 가서 실행 하기:
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>pyinstaller.py ..\BlogsToWordpress\BlogsToWordpress.py
232 INFO: wrote D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\BlogsToWordpress.spec
250 INFO: Testing for ability to set icons, version resources...
269 INFO: ... resource update available
272 INFO: UPX is not available.
1437 INFO: checking Analysis
1437 INFO: building Analysis because out00-Analysis.toc non existent
1437 INFO: running Analysis out00-Analysis.toc
1439 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
3074 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
3075 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b.manifest
3081 INFO: Searching for file msvcr90.dll
3081 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcr90.dll
3081 INFO: Searching for file msvcp90.dll
3082 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcp90.dll
3082 INFO: Searching for file msvcm90.dll
3082 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcm90.dll
3292 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support\_pyi_bootstrap.py
4048 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\archive.py
4101 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\carchive.py
4159 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.py
4176 INFO: Analyzing ..\BlogsToWordpress\BlogsToWordpress.py
4880 INFO: Hidden import 'encodings' has been found otherwise
4881 INFO: Looking for run-time hooks
4881 INFO: Analyzing rthook D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support/rthooks/pyi_rth_encodings.py
5523 INFO: Warnings written to D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\warnBlogsToWordpress.txt
5528 INFO: checking PYZ
5529 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
5529 INFO: building PYZ out00-PYZ.toc
6225 INFO: checking PKG
6226 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
6226 INFO: building PKG out00-PKG.pkg
6246 INFO: checking EXE
6246 INFO: rebuilding out00-EXE.toc because BlogsToWordpress.exe missing
6248 INFO: building EXE from out00-EXE.toc
6256 INFO: Appending archive to EXE D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\BlogsToWordpress.exe
6259 INFO: checking COLLECT
6259 INFO: building COLLECT out00-COLLECT.toc
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>
볼 수 있 습 니 다:현재 pyinstaller 아래 에 해당 하 는 BlogsToWordpress 폴 더 가 생 성 되 었 습 니 다.
그 아래 에 도 대응 하 는 것 이 있다.
대응 하 는 exe 가 생 성 되 었 습 니 다:
dist 아래 에 대응 하 는 exe,pyd,dll 등 이 있 습 니 다.
땀,효율 도 너무 높 아 요.한참 을 고생 해 야 될 줄 알았어 요.
9.먼저 생 성 된 exe 가 우리 의 수 요 를 만족 시 키 고 독립 적 으로 운행 할 수 있 는 지 시험 해 보 세 요.
하지만 실행 하기 전에 해당 하 는 매개 변 수 를 연구 해 보 세 요.
보 았 다:
What to generate:
-F, --onefile
create a single file deployment
-D, --onedir
create a single directory deployment (default)
-o DIR, --out=DIR
create the spec file in directory. If not specified, and the current directory is Installer's root directory, an output subdirectory will be created. Otherwise the current directory is used.
-n NAME, --name=NAME
optional name to assign to the project (from which the spec file name is generated). If omitted, the basename of the (first) script is used.
기본 값 은-D 를 사용 하기 때문에 디 렉 터 리 가 있 는 것 이 분명 합 니 다.지금 다시 실행 하고-F 를 사용 하여 단일 파일 을 만 듭 니 다.
10.낡은 것 을 지 워 라.다시 실행:
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>pyinstaller.py -F ..\BlogsToWordpress\BlogsToWordpress.py
39 INFO: wrote D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\BlogsToWordpress.spec
55 INFO: Testing for ability to set icons, version resources...
62 INFO: ... resource update available
63 INFO: UPX is not available.
848 INFO: checking Analysis
848 INFO: building Analysis because out00-Analysis.toc non existent
849 INFO: running Analysis out00-Analysis.toc
851 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
905 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
907 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b.manifest
908 INFO: Searching for file msvcr90.dll
908 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcr90.dll
911 INFO: Searching for file msvcp90.dll
911 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcp90.dll
912 INFO: Searching for file msvcm90.dll
914 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcm90.dll
987 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support\_pyi_bootstrap.py
1639 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\archive.py
1694 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\carchive.py
1750 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.py
1766 INFO: Analyzing ..\BlogsToWordpress\BlogsToWordpress.py
2246 INFO: Hidden import 'encodings' has been found otherwise
2247 INFO: Looking for run-time hooks
2249 INFO: Analyzing rthook D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support/rthooks/pyi_rth_encodings.py
2608 INFO: Warnings written to D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\warnBlogsToWordpress.txt
2611 INFO: checking PYZ
2612 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
2613 INFO: building PYZ out00-PYZ.toc
3290 INFO: checking PKG
3290 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
3292 INFO: building PKG out00-PKG.pkg
4784 INFO: checking EXE
4784 INFO: rebuilding out00-EXE.toc because BlogsToWordpress.exe missing
4786 INFO: building EXE from out00-EXE.toc
4793 INFO: Appending archive to EXE D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist\BlogsToWordpress.exe
결 과 를 보 러 가다.pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress
아래 에는 toc,pkg,pyz 등 파일 이 많이 포함 되 어 있 습 니 다.
dist 아래 에 필요 한 단일 exe 파일 이 생 성 되 었 습 니 다:
그러나 생 성 파일 에 경고 가 포 함 된 파일 이 있 음 을 알 수 있 습 니 다.
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\warnBlogsToWordpress.txt
W: no module named org (delayed import by xml.sax)
W: no module named _scproxy (conditional import by urllib)
W: no module named cl (delayed, conditional import by aifc)
W: no module named pwd (delayed, conditional import by posixpath)
W: no module named org (top-level import by pickle)
W: no module named Carbon (delayed import by plistlib)
W: no module named posix (delayed, conditional import by __main__)
W: no module named fcntl (conditional import by subprocess)
W: no module named BlogBaidu (top-level import by __main__)
W: no module named BlogCsdn (top-level import by __main__)
W: no module named BlogBlogbus (top-level import by __main__)
W: no module named java (conditional import by xml.sax._exceptions)
W: no module named BlogTianya (top-level import by __main__)
W: no module named readline (delayed import by pdb)
W: no module named AES (delayed, conditional import by archive)
W: no module named _emx_link (conditional import by os)
W: no module named pwd (delayed import by getpass)
W: no module named posix (delayed, conditional import by iu)
W: no module named EasyDialogs (conditional import by getpass)
W: no module named termios (top-level import by getpass)
W: no module named gestalt (delayed import by platform)
W: no module named org (top-level import by copy)
W: no module named fcntl (top-level import by tempfile)
W: no module named readline (delayed, conditional import by cmd)
W: no module named crifanLib (top-level import by __main__)
W: no module named SOCKS (top-level import by ftplib)
W: no module named java (delayed import by platform)
W: no module named cl (delayed import by aifc)
W: no module named BlogQQ (top-level import by __main__)
W: no module named xmlparse (top-level import by pyexpat)
W: no module named xmltok (top-level import by pyexpat)
W: no module named BlogDiandian (top-level import by __main__)
W: no module named BlogSohu (top-level import by __main__)
W: no module named BlogRenren (top-level import by __main__)
W: no module named AES (delayed, conditional import by __main__)
W: no module named posix (conditional import by os)
W: no module named BlogNetease (top-level import by __main__)
W: no module named MacOS (delayed import by platform)
W: no module named vms_lib (delayed, conditional import by platform)
W: no module named rourl2path (conditional import by urllib)
W: no module named _xmlplus (top-level import by xml)
W: no module named Crypt (delayed, conditional import by __main__)
W: no module named BlogSina (top-level import by __main__)
W: delayed exec statement detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed __import__ hack detected at line 0 - optparse (D:\tmp\dev_install_root\Python27_x64\lib\optparse.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: delayed exec statement detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: __all__ is built strangely at line 0 - tokenize (D:\tmp\dev_install_root\Python27_x64\lib\tokenize.pyc)
W: __all__ is built strangely at line 0 - tokenize (D:\tmp\dev_install_root\Python27_x64\lib\tokenize.pyc)
W: delayed __import__ hack detected at line 0 - pickle (D:\tmp\dev_install_root\Python27_x64\lib\pickle.pyc)
W: delayed __import__ hack detected at line 0 - pickle (D:\tmp\dev_install_root\Python27_x64\lib\pickle.pyc)
W: delayed __import__ hack detected at line 0 - encodings (D:\tmp\dev_install_root\Python27_x64\lib\encodings\__init__.pyc)
W: __all__ is built strangely at line 0 - dis (D:\tmp\dev_install_root\Python27_x64\lib\dis.pyc)
W: __all__ is built strangely at line 0 - hashlib (D:\tmp\dev_install_root\Python27_x64\lib\hashlib.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (D:\tmp\dev_install_root\Python27_x64\lib\warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (D:\tmp\dev_install_root\Python27_x64\lib\warnings.pyc)
W: delayed __import__ hack detected at line 0 - email (D:\tmp\dev_install_root\Python27_x64\lib\email\__init__.pyc)
W: delayed exec statement detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional exec statement detected at line 0 - iu (D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.pyc)
W: __all__ is built strangely at line 0 - collections (D:\tmp\dev_install_root\Python27_x64\lib\collections.pyc)
W: delayed exec statement detected at line 0 - collections (D:\tmp\dev_install_root\Python27_x64\lib\collections.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.main (D:\tmp\dev_install_root\Python27_x64\lib\unittest\main.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: delayed __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: __all__ is built strangely at line 0 - __future__ (D:\tmp\dev_install_root\Python27_x64\lib\__future__.pyc)
W: delayed __import__ hack detected at line 0 - xml.sax (D:\tmp\dev_install_root\Python27_x64\lib\xml\sax\__init__.pyc)
W: delayed eval hack detected at line 0 - gettext (D:\tmp\dev_install_root\Python27_x64\lib\gettext.pyc)
프로그램 에 영향 을 미 칠 지 모 르 겠 습 니 다.11.하나의 exe 를 실행 하고 효 과 를 봅 니 다.
결과 직접 오류 발생:
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist>BlogsToWordpress.exe
Traceback (most recent call last):
File "<string>", line 127, in <module>
File "D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.py", line 409, in importHook
raise ImportError("No module named %s" % fqname)
ImportError: No module named crifanLib
많은 라 이브 러 리 를 자동 으로 가 져 올 수 없 음 이 분명 합 니 다.검색 경 로 를 추가 하여 해당 하 는 라 이브 러 리 를 찾 을 수 있 도록 방법 을 강구 하 세 요.
12.-p 인자 인 것 같 습 니 다.
-p DIR, --paths=DIR
set base path for import (like using PYTHONPATH). Multiple directories are allowed, separating them with the path separator (‘;' under Windows, ‘:' under Linux), or using this option multiple times.
해 봐:
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>pyinstaller.py -F -p D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs;D:\tmp\tmp_dev_root\python\tutorial
_summary\make_exe\BlogsToWordpress\libs\crifan;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\crifan\blogModules;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsT
oWordpress\libs\thirdparty;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\thirdparty\chardet; ..\BlogsToWordpress\BlogsToWordpress.py
18 INFO: wrote D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\BlogsToWordpress.spec
33 INFO: Testing for ability to set icons, version resources...
36 INFO: ... resource update available
39 INFO: UPX is not available.
674 INFO: checking Analysis
677 INFO: building because pathex changed
679 INFO: running Analysis out00-Analysis.toc
680 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
733 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
735 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b.manifest
736 INFO: Searching for file msvcr90.dll
736 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcr90.dll
738 INFO: Searching for file msvcp90.dll
739 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcp90.dll
740 INFO: Searching for file msvcm90.dll
743 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcm90.dll
812 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support\_pyi_bootstrap.py
1512 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\archive.py
1578 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\carchive.py
1648 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.py
1667 INFO: Analyzing ..\BlogsToWordpress\BlogsToWordpress.py
3016 INFO: Hidden import 'encodings' has been found otherwise
3016 INFO: Looking for run-time hooks
3018 INFO: Analyzing rthook D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support/rthooks/pyi_rth_encodings.py
3670 INFO: Warnings written to D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\warnBlogsToWordpress.txt
3674 INFO: checking PYZ
3679 INFO: building because toc changed
3679 INFO: building PYZ out00-PYZ.toc
5713 INFO: checking PKG
5716 INFO: building because D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\out00-PYZ.pyz changed
5717 INFO: building PKG out00-PKG.pkg
7163 INFO: checking EXE
7164 INFO: rebuilding out00-EXE.toc because pkg is more recent
7164 INFO: building EXE from out00-EXE.toc
7167 INFO: Appending archive to EXE D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist\BlogsToWordpress.exe
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>
경 로 를 추가 한 후에 생 성 된 exe 도 조금 커 졌 고 4505 KB 가 되 었 습 니 다.또한,warnBlogs ToWordpress.txt 에 crifanLib 가 없 는 것 은 사실 이지 만,의존 할 수 있 는 다른 라 이브 러 리 가 있 습 니 다.
W: no module named org (delayed import by xml.sax)
W: no module named PIL (delayed import by BlogRenren)
W: no module named _dummy_threading (top-level import by dummy_threading)
W: no module named cl (delayed, conditional import by aifc)
W: no module named pwd (delayed, conditional import by posixpath)
W: no module named org (top-level import by pickle)
W: no module named Carbon (delayed import by plistlib)
W: no module named PIL (delayed, conditional import by BlogNetease)
W: no module named posix (delayed, conditional import by __main__)
W: no module named iconv_codec (top-level import by BeautifulSoup)
W: no module named fcntl (conditional import by subprocess)
W: no module named MacOS (delayed import by platform)
W: no module named readline (delayed import by pdb)
W: no module named AES (delayed, conditional import by archive)
W: no module named _scproxy (conditional import by urllib)
W: no module named pwd (delayed import by getpass)
W: no module named posix (delayed, conditional import by iu)
W: no module named EasyDialogs (conditional import by getpass)
W: no module named termios (top-level import by getpass)
W: no module named gestalt (delayed import by platform)
W: no module named org (top-level import by copy)
W: no module named fcntl (top-level import by tempfile)
W: no module named cjkcodecs (top-level import by BeautifulSoup)
W: no module named readline (delayed, conditional import by cmd)
W: no module named java (delayed import by platform)
W: no module named cl (delayed import by aifc)
W: no module named xmlparse (top-level import by pyexpat)
W: no module named xmltok (top-level import by pyexpat)
W: no module named java (conditional import by xml.sax._exceptions)
W: no module named _emx_link (conditional import by os)
W: no module named posix (conditional import by os)
W: no module named rourl2path (conditional import by urllib)
W: no module named vms_lib (delayed, conditional import by platform)
W: no module named SOCKS (top-level import by ftplib)
W: no module named _xmlplus (top-level import by xml)
W: no module named Crypt (delayed, conditional import by __main__)
W: no module named AES (delayed, conditional import by __main__)
W: delayed exec statement detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed __import__ hack detected at line 0 - optparse (D:\tmp\dev_install_root\Python27_x64\lib\optparse.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: delayed exec statement detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: __all__ is built strangely at line 0 - tokenize (D:\tmp\dev_install_root\Python27_x64\lib\tokenize.pyc)
W: __all__ is built strangely at line 0 - tokenize (D:\tmp\dev_install_root\Python27_x64\lib\tokenize.pyc)
W: delayed __import__ hack detected at line 0 - pickle (D:\tmp\dev_install_root\Python27_x64\lib\pickle.pyc)
W: delayed __import__ hack detected at line 0 - pickle (D:\tmp\dev_install_root\Python27_x64\lib\pickle.pyc)
W: delayed __import__ hack detected at line 0 - encodings (D:\tmp\dev_install_root\Python27_x64\lib\encodings\__init__.pyc)
W: __all__ is built strangely at line 0 - dummy_threading (D:\tmp\dev_install_root\Python27_x64\lib\dummy_threading.pyc)
W: __all__ is built strangely at line 0 - dis (D:\tmp\dev_install_root\Python27_x64\lib\dis.pyc)
W: __all__ is built strangely at line 0 - hashlib (D:\tmp\dev_install_root\Python27_x64\lib\hashlib.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (D:\tmp\dev_install_root\Python27_x64\lib\warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (D:\tmp\dev_install_root\Python27_x64\lib\warnings.pyc)
W: delayed __import__ hack detected at line 0 - email (D:\tmp\dev_install_root\Python27_x64\lib\email\__init__.pyc)
W: delayed exec statement detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional exec statement detected at line 0 - iu (D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.pyc)
W: __all__ is built strangely at line 0 - collections (D:\tmp\dev_install_root\Python27_x64\lib\collections.pyc)
W: delayed exec statement detected at line 0 - collections (D:\tmp\dev_install_root\Python27_x64\lib\collections.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.main (D:\tmp\dev_install_root\Python27_x64\lib\unittest\main.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: delayed __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: __all__ is built strangely at line 0 - __future__ (D:\tmp\dev_install_root\Python27_x64\lib\__future__.pyc)
W: delayed __import__ hack detected at line 0 - xml.sax (D:\tmp\dev_install_root\Python27_x64\lib\xml\sax\__init__.pyc)
W: delayed eval hack detected at line 0 - gettext (D:\tmp\dev_install_root\Python27_x64\lib\gettext.pyc)
예 를 들 어 그 중의 PIL 등 창고. 그런데 PIL 에 대해 서 제 것 을 보 러 갔 어 요.
D:\tmp\dev_install_root\Python27_x64\Lib\site-packages
확실히 없습니다.python 을 다시 설치 해서 이전에 설 치 된 PIL 이 없어 졌 을 것 입 니 다.
그래서 스스로 PIL 을 다시 설치 해 야 합 니 다.
12.PIL 을 설치 하 는 과정 에 대해 상세 한 내용 은 다음 과 같다.
【기 록】Python 의 제3자 이미지 처 리 를 다운로드 하고 설치 한 라 이브 러 리:PIL(Python Imaging Library)
13.그리고 다시 갑 니 다.
D:\tmp\dev_install_root\Python27_x64\Lib\site-packages
확인 해 보 니 과연 PIL 이 생 겼 군.
그리고 여기 서 오래된 것 을 지우 고 다시 실행 합 니 다.
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>pyinstaller.py -F -p D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs;D:\tmp\tmp_dev_root\python\tutorial
_summary\make_exe\BlogsToWordpress\libs\crifan;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\crifan\blogModules;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsT
oWordpress\libs\thirdparty;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\thirdparty\chardet; ..\BlogsToWordpress\BlogsToWordpress.py
18 INFO: wrote D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\BlogsToWordpress.spec
33 INFO: Testing for ability to set icons, version resources...
37 INFO: ... resource update available
39 INFO: UPX is not available.
684 INFO: checking Analysis
684 INFO: building Analysis because out00-Analysis.toc non existent
684 INFO: running Analysis out00-Analysis.toc
685 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
740 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
741 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b.manifest
742 INFO: Searching for file msvcr90.dll
743 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcr90.dll
744 INFO: Searching for file msvcp90.dll
745 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcp90.dll
747 INFO: Searching for file msvcm90.dll
750 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_750b37ff97f4f68b\msvcm90.dll
821 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support\_pyi_bootstrap.py
1531 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\archive.py
1600 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\carchive.py
1672 INFO: Analyzing D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.py
1692 INFO: Analyzing ..\BlogsToWordpress\BlogsToWordpress.py
2903 INFO: Hidden import 'encodings' has been found otherwise
2904 INFO: Looking for run-time hooks
2905 INFO: Analyzing rthook D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support/rthooks/pyi_rth_PIL_Image.py
2917 INFO: Analyzing rthook D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\support/rthooks/pyi_rth_encodings.py
3319 INFO: Warnings written to D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\warnBlogsToWordpress.txt
3325 INFO: checking PYZ
3326 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing
3326 INFO: building PYZ out00-PYZ.toc
5360 INFO: checking PKG
5360 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing
5361 INFO: building PKG out00-PKG.pkg
6839 INFO: checking EXE
6839 INFO: rebuilding out00-EXE.toc because BlogsToWordpress.exe missing
6840 INFO: building EXE from out00-EXE.toc
6842 INFO: Appending archive to EXE D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist\BlogsToWordpress.exe
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>
결과 경고 에 도 PIL 이 있 습 니 다.
W: no module named org (delayed import by xml.sax)
W: no module named _dummy_threading (top-level import by dummy_threading)
W: no module named cl (delayed, conditional import by aifc)
W: no module named pwd (delayed, conditional import by posixpath)
W: no module named org (top-level import by pickle)
W: no module named Carbon (delayed import by plistlib)
W: no module named posix (delayed, conditional import by __main__)
W: no module named iconv_codec (top-level import by BeautifulSoup)
W: no module named fcntl (conditional import by subprocess)
W: no module named MacOS (delayed import by platform)
W: no module named readline (delayed import by pdb)
W: no module named AES (delayed, conditional import by archive)
W: no module named _scproxy (conditional import by urllib)
W: no module named pwd (delayed import by getpass)
W: no module named posix (delayed, conditional import by iu)
W: no module named EasyDialogs (conditional import by getpass)
W: no module named termios (top-level import by getpass)
W: no module named gestalt (delayed import by platform)
W: no module named org (top-level import by copy)
W: no module named _imaging_gif (top-level import by PIL.GifImagePlugin)
W: no module named fcntl (top-level import by tempfile)
W: no module named cjkcodecs (top-level import by BeautifulSoup)
W: no module named readline (delayed, conditional import by cmd)
W: no module named java (delayed import by platform)
W: no module named cl (delayed import by aifc)
W: no module named xmlparse (top-level import by pyexpat)
W: no module named xmltok (top-level import by pyexpat)
W: no module named java (conditional import by xml.sax._exceptions)
W: no module named _emx_link (conditional import by os)
W: no module named posix (conditional import by os)
W: no module named ICCProfile (delayed, conditional import by PIL.PngImagePlugin)
W: no module named rourl2path (conditional import by urllib)
W: no module named vms_lib (delayed, conditional import by platform)
W: no module named SOCKS (top-level import by ftplib)
W: no module named _xmlplus (top-level import by xml)
W: no module named Crypt (delayed, conditional import by __main__)
W: no module named AES (delayed, conditional import by __main__)
W: delayed exec statement detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed eval hack detected at line 0 - bdb (D:\tmp\dev_install_root\Python27_x64\lib\bdb.pyc)
W: delayed __import__ hack detected at line 0 - optparse (D:\tmp\dev_install_root\Python27_x64\lib\optparse.pyc)
W: delayed __import__ hack detected at line 0 - PIL.Image (D:\tmp\dev_install_root\Python27_x64\lib\site-packages\PIL\Image.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: delayed exec statement detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: delayed conditional __import__ hack detected at line 0 - doctest (D:\tmp\dev_install_root\Python27_x64\lib\doctest.pyc)
W: __all__ is built strangely at line 0 - tokenize (D:\tmp\dev_install_root\Python27_x64\lib\tokenize.pyc)
W: __all__ is built strangely at line 0 - tokenize (D:\tmp\dev_install_root\Python27_x64\lib\tokenize.pyc)
W: delayed __import__ hack detected at line 0 - pickle (D:\tmp\dev_install_root\Python27_x64\lib\pickle.pyc)
W: delayed __import__ hack detected at line 0 - pickle (D:\tmp\dev_install_root\Python27_x64\lib\pickle.pyc)
W: delayed __import__ hack detected at line 0 - encodings (D:\tmp\dev_install_root\Python27_x64\lib\encodings\__init__.pyc)
W: __all__ is built strangely at line 0 - dummy_threading (D:\tmp\dev_install_root\Python27_x64\lib\dummy_threading.pyc)
W: __all__ is built strangely at line 0 - dis (D:\tmp\dev_install_root\Python27_x64\lib\dis.pyc)
W: __all__ is built strangely at line 0 - hashlib (D:\tmp\dev_install_root\Python27_x64\lib\hashlib.pyc)
W: delayed conditional eval hack detected at line 0 - warnings (D:\tmp\dev_install_root\Python27_x64\lib\warnings.pyc)
W: delayed conditional __import__ hack detected at line 0 - warnings (D:\tmp\dev_install_root\Python27_x64\lib\warnings.pyc)
W: delayed __import__ hack detected at line 0 - email (D:\tmp\dev_install_root\Python27_x64\lib\email\__init__.pyc)
W: delayed exec statement detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed eval hack detected at line 0 - pdb (D:\tmp\dev_install_root\Python27_x64\lib\pdb.pyc)
W: delayed conditional exec statement detected at line 0 - iu (D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.pyc)
W: delayed conditional exec statement detected at line 0 - iu (D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\PyInstaller\loader\iu.pyc)
W: __all__ is built strangely at line 0 - collections (D:\tmp\dev_install_root\Python27_x64\lib\collections.pyc)
W: delayed exec statement detected at line 0 - collections (D:\tmp\dev_install_root\Python27_x64\lib\collections.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.main (D:\tmp\dev_install_root\Python27_x64\lib\unittest\main.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: delayed conditional __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: delayed __import__ hack detected at line 0 - unittest.loader (D:\tmp\dev_install_root\Python27_x64\lib\unittest\loader.pyc)
W: __all__ is built strangely at line 0 - __future__ (D:\tmp\dev_install_root\Python27_x64\lib\__future__.pyc)
W: delayed __import__ hack detected at line 0 - xml.sax (D:\tmp\dev_install_root\Python27_x64\lib\xml\sax\__init__.pyc)
W: delayed eval hack detected at line 0 - gettext (D:\tmp\dev_install_root\Python27_x64\lib\gettext.pyc)
하지만 PIL 모듈 내부 의 작은 문제 일 뿐 무시 한 것 은 분명 하 다.생 성 된 exe,확실히 또 커 졌 습 니 다.4748 KB:
13.현재 의 최신 Blogs ToWordpress.exe 를 실행 하고 효과 가 어떤 지 봅 시다.
과연 가능 합 니 다.기대 한 대로 실 행 했 습 니 다.
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist>BlogsToWordpress.exe
Imported: crifanLib, v2.4
Imported: BlogNetease, v1.4
Imported: BlogBaidu, v3.4
Imported: BlogSina, v1.5
Imported: BlogQQ, v1.8
Imported: BlogCsdn, v1.1
Imported: BlogSohu, v1.3
LINE 1600 : INFO Current runtime info:
LINE 1600 : INFO Paramenters : ['D:\\tmp\\tmp_dev_root\\python\\tutorial_summary\\make_exe\\pyinstaller-2.0\\BlogsToWordpress\\dist\\BlogsToWordpress.exe']
LINE 1600 : INFO Python version : sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
LINE 1600 : INFO platform.machine()=AMD64
LINE 1600 : INFO platform.node()=PC-CLI-1
LINE 1600 : INFO platform.platform()=Windows-7-6.1.7601-SP1
LINE 1600 : INFO platform.processor()=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
LINE 1600 : INFO platform.python_build()=('default', 'Apr 10 2012 23:24:47')
LINE 1600 : INFO platform.python_compiler()=MSC v.1500 64 bit (AMD64)
LINE 1600 : INFO platform.python_branch()=
LINE 1600 : INFO platform.python_implementation()=CPython
LINE 1600 : INFO platform.python_revision()=
LINE 1600 : INFO platform.python_version()=2.7.3
LINE 1600 : INFO platform.python_version_tuple()=('2', '7', '3')
LINE 1600 : INFO platform.release()=7
LINE 1600 : INFO platform.system()=Windows
LINE 1600 : INFO platform.version()=6.1.7601
LINE 1600 : INFO platform.uname()=('Windows', 'PC-CLI-1', '7', '6.1.7601', 'AMD64', 'Intel64 Family 6 Model 42 Stepping 7, GenuineIntel')
LINE 1600 : INFO Default encoding : ascii
LINE 1600 : INFO Current path : C:\Users\CLi\AppData\Local\Temp\_MEI252922
LINE 1600 : INFO :v16.8
LINE 1600 : INFO 1. , (1) (2) (3) BlogsToWordpress.log , 、 、
LINE 1600 : INFO admin(at)crifan.com ( ) , , , !
LINE 1600 : INFO 2. , -h 。
LINE 1600 : INFO 3. , :
LINE 1600 : INFO BlogsToWordPress: ( ), 163, Sina,QQ , ,CSDN, Sohu, Blogbus, , WordPress
LINE 1600 : INFO https://www.crifan.com/crifan_released_all/website/python/blogstowordpress/
LINE 1600 : INFO --------------------------------------------------------------------------------
LINE 1600 : INFO Your process type of post is: Export post to WXR(WordPress eXtended Rss).
LINE 1575 : ERROR Must designate the entry URL for the first blog item !
LINE 1575 : ERROR Unknown Error !
Traceback (most recent call last):
File "<string>", line 1931, in <module>
File "<string>", line 1655, in main
SystemExit: 2
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist>
대응 하 는 파 라 메 터 를 추가 하고 다시 시도 합 니 다.
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist>BlogsToWordpress.exe -s http://againinput4.blog.163.com
Imported: crifanLib, v2.4
Imported: BlogNetease, v1.4
Imported: BlogBaidu, v3.4
Imported: BlogSina, v1.5
Imported: BlogQQ, v1.8
Imported: BlogCsdn, v1.1
Imported: BlogSohu, v1.3
LINE 1600 : INFO Current runtime info:
LINE 1600 : INFO Paramenters : ['D:\\tmp\\tmp_dev_root\\python\\tutorial_summary\\make_exe\\pyinstaller-2.0\\BlogsToWordpress\\dist\\BlogsToWordpress.exe', '-s', 'http://againinput4.blog.163
.com']
LINE 1600 : INFO Python version : sys.version_info(major=2, minor=7, micro=3, releaselevel='final', serial=0)
LINE 1600 : INFO platform.machine()=AMD64
LINE 1600 : INFO platform.node()=PC-CLI-1
LINE 1600 : INFO platform.platform()=Windows-7-6.1.7601-SP1
LINE 1600 : INFO platform.processor()=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
LINE 1600 : INFO platform.python_build()=('default', 'Apr 10 2012 23:24:47')
LINE 1600 : INFO platform.python_compiler()=MSC v.1500 64 bit (AMD64)
...
제대로 할 수 있 는 거 야.나머지 는 다른 windows 플랫폼 에서 테스트 를 많이 해 보 는 것 이 정상 인지 아 닌 지 를 시험 하 는 것 이다.
14.이 어 아이콘 아이콘 을 추가 하 는 일 을 다시 시도 해 볼 계획 이다.
참고 홈 페이지 의매개 변수 해석:
-r FILE[,TYPE[,NAME[,LANGUAGE]]], Cresource=FILE[,TYPE[,NAME[,LANGUAGE]]]
add/update resource of the given type, name and language from FILE to the final executable. FILE can be a data file or an exe/dll. For data files, atleast TYPE and NAME need to be specified, LANGUAGE defaults to 0 or may be specified as wildcard * to update all resources of the given TYPE and NAME. For exe/dll files, all resources from FILE will be added/updated to the final executable if TYPE, NAME and LANGUAGE are omitted or specified as wildcard *.Multiple resources are allowed, using this option multiple times.
실행 하기:
D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0>pyinstaller.py -F -p D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs;D:\tmp\tmp_dev_root\python\tutorial
_summary\make_exe\BlogsToWordpress\libs\crifan;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\crifan\blogModules;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsT
oWordpress\libs\thirdparty;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\thirdparty\chardet; -i ..\BlogsToWordpress\BlogsToWordpress.ico ..\BlogsToWordpress\BlogsToWordpre
ss.py
18 INFO: wrote D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\BlogsToWordpress.spec
34 INFO: Testing for ability to set icons, version resources...
37 INFO: ... resource update available
40 INFO: UPX is not available.
681 INFO: checking Analysis
696 INFO: checking PYZ
709 INFO: checking PKG
711 INFO: building because D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\build\pyi.win32\BlogsToWordpress\BlogsToWordpress.exe.manifest changed
712 INFO: building PKG out00-PKG.pkg
2190 INFO: checking EXE
2192 INFO: building because icon changed
2192 INFO: building EXE from out00-EXE.toc
2207 INFO: SRCPATH [('..\\BlogsToWordpress\\BlogsToWordpress.ico', None)]
2207 INFO: Updating icons from ['..\\BlogsToWordpress\\BlogsToWordpress.ico'] to c:\users\cli\appdata\local\temp\tmpouutgx
2209 INFO: Writing RT_GROUP_ICON 0 resource with 34 bytes
2211 INFO: Writing RT_ICON 1 resource with 1128 bytes
2213 INFO: Writing RT_ICON 2 resource with 4264 bytes
2222 INFO: Appending archive to EXE D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\pyinstaller-2.0\BlogsToWordpress\dist\BlogsToWordpress.exe
아이콘 을 현재 있 는 exe 에 자동 으로 추가 한 다음 아이콘 이 있 는 exe 의 효 과 를 볼 수 있 습 니 다.총결산
PyInstaller,정말 좋 네요.작가 님 들 감사합니다.
간단하게 그 사용 방법 을 요약 한다.
단일 exe 파일 생 성:
pyinstaller.py -F ..\BlogsToWordpress\BlogsToWordpress.py
필요 한 검색 경로 추가:
pyinstaller.py -F -p D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\crifan;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\crifan\blogModules;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\thirdparty;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\thirdparty\chardet; ..\BlogsToWordpress\BlogsToWordpress.py
필요 한 검색 경 로 를 추가 하고 아이콘 을 가 져 옵 니 다:
pyinstaller.py -F -p D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\crifan;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\crifan\blogModules;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\thirdparty;D:\tmp\tmp_dev_root\python\tutorial_summary\make_exe\BlogsToWordpress\libs\thirdparty\chardet; -i ..\BlogsToWordpress\BlogsToWordpress.ico ..\BlogsToWordpress\BlogsToWordpress.py
주의해 야 할 것 은:
1.생 성 검사
pyinstaller-2.0\XXX\build\pyi.win32\XXX\warnXXX.txt
(XXX 는 당신 의 프로젝트 이름 입 니 다)
필요 한 모듈 이 부족 한 지 여부 입 니 다.
부족 한 것 이 있 으 면 위 와 같이 필요 한 검색 경 로 를 추가 하여 pyinstaller 가 실 행 될 때 해당 하 는 모듈 을 찾 아 통합 할 수 있 습 니 다.
2.이곳 에 UPX 가 없어 서 잠시 고생 하지 않 았 습 니 다.
UPX 로 압축 하고 압축 한 후에 생 성 된 exe 파일 의 크기 가 훨씬 작 을 것 으로 추정 된다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Python의 None과 NULL의 차이점 상세 정보그래서 대상 = 속성 + 방법 (사실 방법도 하나의 속성, 데이터 속성과 구별되는 호출 가능한 속성 같은 속성과 방법을 가진 대상을 클래스, 즉 Classl로 분류할 수 있다.클래스는 하나의 청사진과 같아서 하나의 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.