好友
阅读权限10
听众
最后登录1970-1-1
|
可塑型芋头
发表于 2023-1-30 17:39
本帖最后由 可塑型芋头 于 2023-2-2 09:11 编辑
问题描述:
使用pyinstaller打包exe文件,在打包的电脑上可以运行,但在全新安装的虚拟机上无法运行。
pyinstaller命令试过:pyinstaller -Fw main.py;pyinstaller -Fw main.py --path D:\anaconda3_86\Lib\site-packages\PyQt5\Qt5\bin 都不行。
错误截图:
报错截图
打包时日志文件:
warn-main.txt
(3.38 KB, 下载次数: 0)
missing module named org - imported by pickle (optional)
missing module named 'org.python' - imported by copy (optional), xml.sax (delayed, conditional)
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
missing module named pyimod02_importers - imported by D:\anaconda3_86\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py (top-level)
missing module named _scproxy - imported by urllib.request (conditional)
missing module named termios - imported by getpass (optional)
missing module named pwd - imported by posixpath (delayed, conditional), shutil (optional), tarfile (optional), pathlib (delayed, conditional, optional), netrc (delayed, conditional), getpass (delayed)
missing module named grp - imported by shutil (optional), tarfile (optional), pathlib (delayed)
missing module named vms_lib - imported by platform (delayed, conditional, optional)
missing module named 'java.lang' - imported by platform (delayed, optional), xml.sax._exceptions (conditional)
missing module named java - imported by platform (delayed)
missing module named _winreg - imported by platform (delayed, optional), selenium.webdriver.firefox.firefox_binary (delayed, optional)
missing module named _posixsubprocess - imported by subprocess (optional)
missing module named _uuid - imported by uuid (optional)
runtime module named urllib3.packages.six.moves - imported by http.client (top-level), urllib3.util.response (top-level), urllib3.connectionpool (top-level), 'urllib3.packages.six.moves.urllib' (top-level), urllib3.util.queue (top-level)
missing module named StringIO - imported by PyQt5.uic.port_v2.string_io (optional), urllib3.packages.six (conditional)
missing module named 'backports.ssl_match_hostname' - imported by urllib3.packages.ssl_match_hostname (optional)
missing module named "'urllib3.packages.six.moves.urllib'.parse" - imported by urllib3.request (top-level), urllib3.poolmanager (top-level)
missing module named Queue - imported by urllib3.util.queue (conditional)
missing module named 'typing.io' - imported by importlib.resources (top-level)
missing module named cStringIO - imported by xlrd.timemachine (conditional), PyQt5.uic.port_v2.string_io (optional)
missing module named copy_reg - imported by cStringIO (top-level)
missing module named port_v2 - imported by PyQt5.uic.properties (conditional)
missing module named posix - imported by os (conditional, optional), shutil (conditional)
missing module named resource - imported by posix (top-level)
部分导包源码:
import os
import sys
import time
from shutil import copyfile
import xlrd
from PyQt5.QtCore import QDate, QDir
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QLineEdit, QMessageBox
from PyQt5.uic.properties import QtCore
from selenium.webdriver.support.select import Select
from auto_chuna_ui import Ui_MainWindow
from selenium import webdriver
options = webdriver.ChromeOptions()
# options.add_argument('--headless')
options.add_argument("--remote-debugging-port=9222")
# options.headless = True # todo debug时加上注释
options.add_experimental_option('detach', True) # 设置不自动关闭浏览器,可以放在函数内,但会重复生成浏览器窗口
driver = webdriver.Chrome(options=options)
其他说明:
打包的系统中找不到C:\Users\JAHON_~1\AppData\Local\Temp\_MEI21522\PyQt5\Qt5\bin这个文件夹或文件。
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|