Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[问题] 重启时报错找不到文件 #442

Closed
MoRanYue opened this issue May 27, 2023 · 3 comments
Closed

[问题] 重启时报错找不到文件 #442

MoRanYue opened this issue May 27, 2023 · 3 comments
Labels
question Further information is requested

Comments

@MoRanYue
Copy link

MoRanYue commented May 27, 2023

确认

  • 我的Bot版本已更新到最新,且已尝试使用nb paimon install更新依赖库
  • 我已查阅文档-常见问题,无相关解决方案
  • 我已确认issue中没有类似的问题或仍然得不到解决

环境信息

  • 系统版本: Windows server 2022
  • Python版本: 3.9.9
  • Nonebot2版本: 2.0.0rc4

问题描述

可以正常用nb paimon run这样的命令打开。但是当使用“@bot 重启”命令时,控制台报错,找不到Python可执行文件。

可执行文件在C:/Program Files中,它似乎寻找的是bot.py所在目录的Files/Python39/python.exe

换了个路径重新配置,问题依旧。

问题截图

7ef281c41844b473

复现步骤[可选]

  1. nb paimon run运行bot。
  2. 使用“@bot 重启”命令。
  3. bot正常关闭。
  4. 控制台报错如上图。
@MoRanYue MoRanYue added the question Further information is requested label May 27, 2023
@CMHopeSunshine
Copy link
Owner

解释器路径是由python标准库sys提供的,路径不对那是python自己的问题了,有没有考虑使用虚拟环境呢?

@MoRanYue
Copy link
Author

康完相关源代码后,我觉得很奇怪。明明直接使用原来的启动命令来重启bot,都可以直接启动,却在它内部执行命令还会找成“CWD/Files/Python39”……

@MoRanYue
Copy link
Author

可以了,在虚拟环境中重新配置了一遍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants