- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
您好!
我正在尝试使用 PyInstaller 进行构建。配置:Python 3.6.5
pip 10.0.1
,操作系统:Ubuntu 18.04
。使用 virtualenv
(也尝试使用 python -m venv
)。
我的应用程序使用了 apscheduler
、websocket
、_thread
并且似乎某些相关模块存在导入问题。尝试过 pyinstaller --onefile mymain.spec
& pyinstaller --onedir mymain.spec
。在这两种情况下问题仍然存在。如果没有卡住,程序可以正常工作。
这是我尝试运行生成的可执行文件时遇到的错误:
Traceback (most recent call last):
File "apscheduler/schedulers/base.py", line 882, in _create_plugin_instance
KeyError: 'interval'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "cmonitorcli/services/socket_client.py", line 70, in run
File "cmonitorcli/services/scheduler.py", line 36, in add_update_job
File "apscheduler/schedulers/base.py", line 413, in add_job
File "apscheduler/schedulers/base.py", line 907, in _create_trigger
File "apscheduler/schedulers/base.py", line 890, in _create_plugin_instance
LookupError: No trigger by the name "interval" was found
^CTraceback (most recent call last):
File "websocket/_app.py", line 283, in run_forever
File "websocket/_app.py", line 50, in read
KeyboardInterrupt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "cmonitorcli/main.py", line 20, in <module>
File "cmonitorcli/main.py", line 8, in main_job
File "cmonitorcli/client.py", line 29, in __init__
File "cmonitorcli/services/socket_client.py", line 31, in connect
File "websocket/_app.py", line 283, in run_forever
KeyboardInterrupt
模块导入警告:
missing module named 'multiprocessing.forking' - imported by /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/venv/lib/python3.6/site-packages/PyInstaller/loader/rthooks/pyi_rth_multiprocessing.py
missing module named multiprocessing.get_context - imported by multiprocessing, multiprocessing.pool, multiprocessing.managers, multiprocessing.sharedctypes
missing module named multiprocessing.TimeoutError - imported by multiprocessing, multiprocessing.pool
missing module named multiprocessing.BufferTooShort - imported by multiprocessing, multiprocessing.connection
missing module named multiprocessing.AuthenticationError - imported by multiprocessing, multiprocessing.connection
missing module named multiprocessing.set_start_method - imported by multiprocessing, multiprocessing.spawn
missing module named multiprocessing.get_start_method - imported by multiprocessing, multiprocessing.spawn
missing module named multiprocessing.SimpleQueue - imported by multiprocessing, concurrent.futures.process
missing module named pyimod03_importers - imported by /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/venv/lib/python3.6/site-packages/PyInstaller/loader/rthooks/pyi_rth_pkgres.py
missing module named 'pkg_resources.extern.pyparsing' - imported by pkg_resources._vendor.packaging.requirements, pkg_resources._vendor.packaging.markers
missing module named StringIO - imported by six, pkg_resources._vendor.six
missing module named 'win32com.shell' - imported by pkg_resources._vendor.appdirs
missing module named 'com.sun' - imported by pkg_resources._vendor.appdirs
missing module named com - imported by pkg_resources._vendor.appdirs
missing module named win32api - imported by pkg_resources._vendor.appdirs
missing module named win32com - imported by pkg_resources._vendor.appdirs
missing module named 'ctypes.macholib' - imported by ctypes.util
missing module named netbios - imported by uuid
missing module named win32wnet - imported by uuid
missing module named __builtin__ - imported by pkg_resources._vendor.pyparsing
missing module named ordereddict - imported by pkg_resources._vendor.pyparsing
missing module named __main__ - imported by pkg_resources
missing module named pkg_resources.extern.packaging - imported by pkg_resources.extern, pkg_resources
missing module named pkg_resources.extern.appdirs - imported by pkg_resources.extern, pkg_resources
missing module named 'pkg_resources.extern.six.moves' - imported by pkg_resources, pkg_resources._vendor.packaging.requirements
missing module named pkg_resources.extern.six - imported by pkg_resources.extern, pkg_resources
missing module named nt - imported by os, shutil, ntpath, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
missing module named org - imported by pickle, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
excluded module named _frozen_importlib - imported by importlib, importlib.abc, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
missing module named _frozen_importlib_external - imported by importlib._bootstrap, importlib, importlib.abc, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
missing module named _winreg - imported by platform, tzlocal.win32, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py, pkg_resources._vendor.appdirs
missing module named _scproxy - imported by urllib.request
missing module named java - imported by platform, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
missing module named 'java.lang' - imported by platform, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py, xml.sax._exceptions
missing module named vms_lib - imported by platform, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
missing module named winreg - imported by platform, mimetypes, tzlocal.win32, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py, urllib.request
missing module named msvcrt - imported by subprocess, multiprocessing.spawn, multiprocessing.popen_spawn_win32, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py, getpass
missing module named _winapi - imported by subprocess, multiprocessing.reduction, multiprocessing.connection, multiprocessing.heap, multiprocessing.popen_spawn_win32, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
missing module named _dummy_threading - imported by dummy_threading, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py
missing module named 'org.python' - imported by copy, /home/hoop/PycharmProjects/cmonitorserv/cmonitorcli/main.py, xml.sax
missing module named funcsigs - imported by apscheduler.util
missing module named sets - imported by pytz.tzinfo
missing module named UserDict - imported by pytz.lazy
missing module named wsaccel - imported by websocket._utils
missing module named backports - imported by websocket._ssl_compat
missing module named socks - imported by websocket._http
missing module named "'six.moves.urllib'.parse" - imported by websocket._url
missing module named Cookie - imported by websocket._cookiejar
missing module named 'wsaccel.xormask' - imported by websocket._abnf
missing module named numpy - imported by websocket._abnf
missing module named win32evtlog - imported by logging.handlers
missing module named win32evtlogutil - imported by logging.handlers
requirements.txt:
jsonpickle==0.9.6
pkg-resources==0.0.0
six==1.11.0
websocket-client==0.48.0
apscheduler==3.5.1
pyinstaller==3.3.1
我需要构建一个--onefile
。
注意使用 hiddenimports
的例子:
missing module named 'wsaccel.xormask' - imported by websocket._abnf
missing module named numpy - imported by websocket._abnf
missing module named win32evtlog - imported by logging.handlers
和任何其他模块都没有帮助 - 它们仍然出现在带有 missing module
标志的日志中
最佳答案
基于 Alex Grönholm
回复:
问题确实是因为 APScheduler
使用 setuptools
入口点来查找触发器类。
解决方案是实例化触发器并传递给add_job()
:
from apscheduler.schedulers.background import BackgroundScheduler
from apscheduler.triggers import interval
scheduler = BackgroundScheduler()
trigger = interval.IntervalTrigger(seconds=3)
scheduler.add_job(lambda: job_func(ws), trigger=trigger, id='status_update_job', replace_existing=True)
关于python - Pyinstaller 3.3.1 & 3.4.0-dev 使用 apscheduler 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51124464/
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
i=5 expr $i + 6 1>/dev/null 将标准输出重定向到/dev/null。怎么样 expr $i + 6 >/dev/null expr $i + 6 1>/dev/null 和
在 R 中,可以握住设备,绘制图片,然后刷新设备来渲染图形。这对于具有数千个数据点、颜色渐变等的非常复杂的绘图非常有用,因为如果不保持,设备将在每次绘图操作后刷新。效果非常好。 但是,一旦绘图就位,任
我想通过串口dev文件执行IPC管道。这是要求首先我尝试使用 sudo socat /dev/ttyS0,raw,echo=0,crnl /dev/ttyS1,raw,echo=0,crnl 报错如下
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 10 年前。 Improve thi
我正在尝试使用 mpg123 播放随机歌曲命令行。但不知道我的默认音频设备是什么。或者如果我需要使用“-a”选项指定任何其他音频设备。/dev/audio 和/dev/dsp 都是音频设备。如何知道哪
我可以看到/dev/uinput 和/dev/input 都存在于我的 Ubuntu 中并且它们很相似。它们可用于检测/模拟按键/鼠标/触摸事件。所以我对它们之间的区别感到困惑?谢谢! 新增:是的,我
cat/dev/urandom 总是一种在显示器上创建滚动字符的有趣方式,但会产生太多不可打印的字符。 有没有一种简单的方法可以在命令行上对其进行编码,使其所有输出都是可读字符,例如 base64 或
是否可以在没有 bit.dev 帐户的情况下将 bit 设置为本地服务器以进行内部处理? 我知道您可能没有相同的功能 -- bit's FAQ page说“与 Bit CLI 不同,bit.dev 服
我试图在 Ubuntu 的启动过程中尽早采样一些随机性。我想知道是否有人建议如何做到这一点。我目前的想法是寻找/dev/random 和/dev/urandom 在引导序列中创建的位置,并在那里添加我
我正在尝试使用'dotnet dev-certs'工具导出https证书以包含在Docker镜像中。现在我正在使用: dotnet dev-certs https -v -ep $(HOME)\.as
我发现非常方便的 dev.copy2pdf 命令可以将我正在查看的窗口复制到 pdf 文件中,如下所示: plot(rnorm(1000)) dev.copy2pdf(file="myfile.pdf
谁能告诉我为什么从硬盘驱动器上清除数据时出于安全性考虑首选/dev/random? 最佳答案 简单的答案,/dev/random不是首选。两者同样安全。使用/dev/zero可以更轻松地进行验证。还可
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我有一个从 initramfs 镜像启动的嵌入式 Linux(vanilla、3.3.8、i486、Vortex86dx)系统。 我有一个 IDE 闪存盘,在/dev/hda1 和/dev/hda2
在Linux中,/dev/ttyS0和/dev/ttys0有什么区别? 我知道第一个是串行端口,但第二个是什么,带有小的 s? 最佳答案 see this For a pseudo terminal
我有一些命名空间的测试被自动加载到包 A 中使用 "autoload-dev": { "psr-4": { "Vendor\\PackageA\\PhpUnit\\": "te
我意识到/dev/stdout 和/dev/stderr 文件在没有根目录的 Android 设备上不存在。我同意这一点——但我需要一些方法来在我的 shell 脚本中重定向输入/输出——包括将输出重
我想对使用 composer 安装的软件包的最低支持版本运行测试,但理想情况下我想要最新版本的开发软件包。 具体来说,我想运行它来安装最低版本的软件包以进行测试: composer update --
我必须将开发分支从 testing 重命名为 tom 。重命名后,我必须创建一个具有相同名称的开发分支,它是 testing 并且它应该指向 master 的特定提交。 我已将分支重命名为: git
我是一名优秀的程序员,十分优秀!