Open
Conversation
Collaborator
|
应该不是目录的问题哈, |
Author
|
个人实践遇到的问题,也按照文档看了,常见问题中说是请确认依赖都已安装,我都安装了,还是这样。事实确实是我加上这段代码就能正常启动了。(在Windows Server系统上) |
Collaborator
目前看应该是个例问题,增加这几行代码处理有点暴力,会对其他平台部署有影响嘛 |
Author
此问题我在Windows Server 2016系统下反复测试过,加上此段代码就能正常运行,去掉就又报这个错误。win10家庭版系统因为本来就能运行,所以也启动测试了,没问题。其他平台尚不清楚,因为我目前只用在这两个系统上,大佬可以在其他平台启动测试一下 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复Windows Server系统下,项目启动找不到(translate.factory)模块的问题。
版本:1.6.0
前置原因:在win10系统下可以正常启动,迁移到Windows Server系统后,启动报错:ModuleNotFoundError: No module named 'translate.factory'。
详细堆栈信息:
Traceback (most recent call last):
File "app.py", line 8, in
from channel import channel_factory
File "D:\chatgpt-on-wechat\channel\channel_factory.py", line 5, in
from .channel import Channel
File "D:\chatgpt-on-wechat\channel\channel.py", line 5, in
from bridge.bridge import Bridge
File "D:\chatgpt-on-wechat\bridge\bridge.py", line 11, in
from translate.factory import create_translator
ModuleNotFoundError: No module named 'translate.factory'
已确认依赖均已下载的情况下,根据错误提示,排查代码找到原因:bridge文件导入的translate.factory模块在文件的上一级目录下,所以在同级目录下找不到此类文件。
解决方案已应用:在目标文件内添加上一级搜索路径。