המרת סקריפט פייתון לקובץ EXE - תכנות - HWzone פורומים
עבור לתוכן
  • צור חשבון

המרת סקריפט פייתון לקובץ EXE


tall978

Recommended Posts

שלום.

אני מנסה להמיר סקריפט שכתבתי בפייתון לקובץ EXE עצמאי ואני נתקל בבעיות בנושא.

הסקריפט שהכנתי מכיר גם ממשק בTkinter לכן חשוב לי להמיר אותו לקובץ עצמאי

משיטוט שלי ברשת מצאתי את הכלי בשם Pyinstaller שממיר את הקוד לקובץ EXE אולם כשניסיתי להשתמש בו אני נתקל בבעיות ולא מצליח לסיים את הפעולה.

הכלי יוצר לי תיקיה חדשה בשם של הקובץ py שאני מעוניין אבל לא מקמפל את כל הקבצים שהכין לקובץ אחד ויחיד.

אשמח לשמוע האם למישהו יש עצה בנושא או כלי אחר שמבצע את מה שאני רוצה.

הקוד שלי מכיר קובץ אחד ויחיד עם סיומת PY ובתוכו מספר פונקציות.

תודה מראש.

קישור לתוכן
שתף באתרים אחרים

הרצתי בצורה הפשוטה ביותר, הנחתי את התיקיה של pyinstaller-2.1 בתיקיה הראשית של פייתון בכונן C, העברתי לתיקיה הזאת את הסקריפט עם סיומת PY , הרצתי את הפקודה pyinstaller.py -F myscript.py וקיבלתי תיקיה באותו השם עם קובץ myscript.spec ועוד תיקיה בשם build. ולא קובץ אחד.

C:\Python27\PyInstaller-2.1>pyinstaller.py -F final.py32 INFO: wrote C:\Python27\PyInstaller-2.1\final\final.spec

55 INFO: Testing for ability to set icons, version resources...

62 INFO: ... resource update available

64 INFO: UPX is not available.

94 INFO: Processing hook hook-os

237 INFO: Processing hook hook-time

244 INFO: Processing hook hook-cPickle

325 INFO: Processing hook hook-_sre

469 INFO: Processing hook hook-cStringIO

590 INFO: Processing hook hook-encodings

610 INFO: Processing hook hook-codecs

1107 INFO: Processing hook hook-httplib

1115 INFO: Processing hook hook-email

1247 INFO: Processing hook hook-email.message

1508 WARNING: library python%s%s required via ctypes not found

1641 INFO: Processing hook hook-xml

1725 INFO: Processing hook hook-xml.sax

1761 INFO: Processing hook hook-pyexpat

1856 INFO: Extending PYTHONPATH with C:\Python27\PyInstaller-2.1

1857 INFO: checking Analysis

1857 INFO: building Analysis because out00-Analysis.toc non existent

1858 INFO: running Analysis out00-Analysis.toc

1859 INFO: Adding .VC90.CRT to dependent assemblies of final executable

1950 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21

022.8_none ...

1951 INFO: Found manifest C:\Windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc

8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest

1953 INFO: Searching for file msvcr90.dll

1954 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_

9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll

1954 INFO: Searching for file msvcp90.dll

1955 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_

9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll

1955 INFO: Searching for file msvcm90.dll

1957 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_

9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll

2063 INFO: Analyzing C:\Python27\PyInstaller-2.1\PyInstaller\loader\_pyi_bootstr

ap.py

2080 INFO: Processing hook hook-os

2097 INFO: Processing hook hook-site

2120 INFO: Processing hook hook-encodings

2263 INFO: Processing hook hook-time

2266 INFO: Processing hook hook-cPickle

2353 INFO: Processing hook hook-_sre

2511 INFO: Processing hook hook-cStringIO

2661 INFO: Processing hook hook-codecs

3210 INFO: Processing hook hook-httplib

3217 INFO: Processing hook hook-email

3359 INFO: Processing hook hook-email.message

3686 WARNING: library python%s%s required via ctypes not found

3809 INFO: Processing hook hook-xml

3886 INFO: Processing hook hook-xml.sax

3921 INFO: Processing hook hook-pyexpat

4040 INFO: Processing hook hook-pydoc

4109 INFO: Analyzing C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_importer

s.py

4316 INFO: Analyzing C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_archive.

py

4510 INFO: Analyzing C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_carchive

.py

4700 INFO: Analyzing C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_os_path.

py

4712 INFO: Analyzing final.py

4792 INFO: Processing hook hook-_tkinter

4957 INFO: checking Tree

4958 INFO: building because out00-Tree.toc missing or bad

4958 INFO: building Tree out00-Tree.toc

5246 INFO: checking Tree

5247 INFO: building because out01-Tree.toc missing or bad

5248 INFO: building Tree out01-Tree.toc

5471 INFO: Hidden import 'codecs' has been found otherwise

5472 INFO: Hidden import 'encodings' has been found otherwise

5475 INFO: Looking for run-time hooks

5477 INFO: Analyzing rthook C:\Python27\PyInstaller-2.1\PyInstaller\loader\rthoo

ks\pyi_rth_Tkinter.py

6609 INFO: Adding .Windows.Common-Controls to dependent assemblies of f

inal executable

6717 INFO: Using Python library C:\Windows\system32\python27.dll

6836 INFO: Warnings written to C:\Python27\PyInstaller-2.1\final\build\final\war

nfinal.txt

6847 INFO: checking PYZ

6848 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing

6849 INFO: building PYZ (ZlibArchive) out00-PYZ.toc

8182 INFO: checking PKG

8184 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing

8184 INFO: building PKG (CArchive) out00-PKG.pkg

Traceback (most recent call last):

File "C:\Python27\PyInstaller-2.1\pyinstaller.py", line 18, in <module>

run()

File "C:\Python27\PyInstaller-2.1\PyInstaller\main.py", line 88, in run

run_build(opts, spec_file, pyi_config)

File "C:\Python27\PyInstaller-2.1\PyInstaller\main.py", line 46, in run_build

PyInstaller.build.main(pyi_config, spec_file, **opts.__dict__)

File "C:\Python27\PyInstaller-2.1\PyInstaller\build.py", line 1924, in main

build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'

))

File "C:\Python27\PyInstaller-2.1\PyInstaller\build.py", line 1873, in build

execfile(spec)

File "C:\Python27\PyInstaller-2.1\final\final.spec", line 17, in <module>

console=True )

File "C:\Python27\PyInstaller-2.1\PyInstaller\build.py", line 1170, in __init_

_

strip_binaries=self.strip, upx_binaries=self.upx,

File "C:\Python27\PyInstaller-2.1\PyInstaller\build.py", line 1008, in __init_

_

self.__postinit__()

File "C:\Python27\PyInstaller-2.1\PyInstaller\build.py", line 309, in __postin

it__

self.assemble()

File "C:\Python27\PyInstaller-2.1\PyInstaller\build.py", line 1069, in assembl

e

archive.build(self.name, mytoc)

File "C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_archive.py", line 217

, in build

self._finalize()

File "C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_carchive.py", line 19

0, in _finalize

self.save_toc(toc_pos)

File "C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_carchive.py", line 35

1, in save_toc

tocstr = self.toc.tobinary()

File "C:\Python27\PyInstaller-2.1\PyInstaller\loader\pyi_carchive.py", line 85

, in tobinary

nmlen + entrylen, dpos, dlen, ulen, flag, typcd, nm + pad))

struct.error: argument for 's' must be a string

קישור לתוכן
שתף באתרים אחרים

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

×
  • צור חדש...