Reputation: 21
I try build exe with pyinstaller.
the test.py is
print('hello')
the warntest.txt
missing module named resource - imported by posix, D:\PythonTest\\test.py
missing module named posix - imported by os, D:\PythonTest\\test.py
missing module named _posixsubprocess - imported by subprocess, D:\PythonTest\\test.py
missing module named 'org.python' - imported by pickle, D:\PythonTest\\test.py, xml.sax
missing module named readline - imported by cmd, code, pdb, D:\PythonTest\\test.py
excluded module named _frozen_importlib - imported by importlib, importlib.abc, D:\PythonTest\\test.py
missing module named _frozen_importlib_external - imported by importlib._bootstrap, importlib, importlib.abc, D:\PythonTest\\test.py
missing module named _winreg - imported by platform, D:\PythonTest\\test.py
missing module named _scproxy - imported by urllib.request
missing module named java - imported by platform, D:\PythonTest\\test.py
missing module named 'java.lang' - imported by platform, D:\PythonTest\\test.py, xml.sax._exceptions
missing module named vms_lib - imported by platform, D:\PythonTest\\test.py
missing module named termios - imported by tty, D:\PythonTest\\test.py, getpass
missing module named grp - imported by shutil, tarfile, D:\PythonTest\\test.py
missing module named pwd - imported by posixpath, shutil, tarfile, http.server, webbrowser, D:\PythonTest\\test.py, netrc, getpass
missing module named _dummy_threading - imported by dummy_threading, D:\PythonTest\\test.py
missing module named org - imported by copy, D:\PythonTest\\test.py
dist test.exe work on some computer.
then I try add code with pypcap:
import pcap
pc = pcap.pcap()
for d,b in pc:
print(d,b)
pyinstaller test.py
the warntest.txt same old one. no missing pcap or pypcap.
missing module named resource - imported by posix, D:\PythonTest\\test.py
missing module named posix - imported by os, D:\PythonTest\\test.py
missing module named _posixsubprocess - imported by subprocess, D:\PythonTest\\test.py
missing module named org - imported by pickle, D:\PythonTest\\test.py
missing module named readline - imported by cmd, code, pdb, D:\PythonTest\\test.py
excluded module named _frozen_importlib - imported by importlib, importlib.abc, D:\PythonTest\\test.py
missing module named _frozen_importlib_external - imported by importlib._bootstrap, importlib, importlib.abc, D:\PythonTest\\test.py
missing module named _winreg - imported by platform, D:\PythonTest\\test.py
missing module named _scproxy - imported by urllib.request
missing module named java - imported by platform, D:\PythonTest\\test.py
missing module named 'java.lang' - imported by platform, D:\PythonTest\\test.py, xml.sax._exceptions
missing module named vms_lib - imported by platform, D:\PythonTest\\test.py
missing module named termios - imported by tty, D:\PythonTest\\test.py, getpass
missing module named grp - imported by shutil, tarfile, D:\PythonTest\\test.py
missing module named pwd - imported by posixpath, shutil, tarfile, http.server, webbrowser, D:\PythonTest\\test.py, netrc, getpass
missing module named _dummy_threading - imported by dummy_threading, D:\PythonTest\\test.py
missing module named 'org.python' - imported by copy, D:\PythonTest\\test.py, xml.sax
dist test.exe worked on my build computer. the other computer prompt DLL load failed:
PS C:\Users\Jack\Desktop\dist\test> .\test.exe
hello
Traceback (most recent call last):
File "test.py", line 10, in
File "D:\PythonEnvi\lib\site-packages\PyInstaller\loader \pyimod03_importers.py", line 714, in load_module
ImportError: DLL load failed: 找不到指定的模块。
[2360] Failed to execute script test
the line 10 is :
import pcap
so i try other way : pyinstaller.exe --hidden-import pcap test.py pyinstaller.exe -p D:\PythonEnvi\Lib\site-packages --hidden-import pcap D:\PythonTest\test.py
windows10 Home 64bit
python 3.63
pyinstaller 3.3.1
pypcap 1.20
npcap 0.98 installer
npcap sdd 0.1
Microsoft Visual C++ Build Tools 2015
Upvotes: 0
Views: 591
Reputation: 21
Accidentally ,I solved the problem.
pypcap need npcap and winpcap API.
different computer install npcap with winpcapAPI,
then build exe work on different computer。
build time inmport pcap。 start they check pcap winpcapAPI. so dll lose。
just install npcap with winpcapAPI,then build work。
Upvotes: 1