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

后端程序运行失败 #15

Open
chen-xin713 opened this issue Feb 2, 2025 · 2 comments
Open

后端程序运行失败 #15

chen-xin713 opened this issue Feb 2, 2025 · 2 comments

Comments

@chen-xin713
Copy link

Image
Image
使用的是py 3.12.4 ,依赖安装成功,但在运行python main.py时出现报错,无法运行后端程序

@QUQNEKO
Copy link

QUQNEKO commented Feb 2, 2025

我解决了兄弟,就是你

  1. 安装 OpenAI 库
    在终端中运行以下命令安装最新版本的 openai:

bash
复制
pip install openai
然后假如
后面遇到PS E:\novel2video-main\novel2video-main\novel2video-main> npm install next --registry=https://registry.npmmirror.com
npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsof
t.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1

  • npm install next --registry=https://registry.npmmirror.com
  •   + CategoryInfo          : SecurityError: (:) [],PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess现在这种报错,
    

你就
输入以下命令查看当前策略:

powershell
复制
Get-ExecutionPolicy
默认通常是 Restricted(禁止所有脚本)。

  1. 修改执行策略
    选择一个合适的策略(推荐使用 RemoteSigned):

powershell
复制
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
选项解释:

RemoteSigned:允许本地脚本运行,远程脚本需签名(平衡安全与便利)。

Bypass:完全绕过执行策略(不推荐,存在安全风险)。

Unrestricted:允许所有脚本(慎用)。
4. 验证策略是否生效
再次检查策略:

powershell
复制
Get-ExecutionPolicy
应显示为 RemoteSigned。
然后输入npm install next --registry=https://registry.npmmirror.com
npm install toastify-js --registry=https://registry.npmmirror.com
策失: 02-03 00:21:09
然后cd front
再npm run dev

@QUQNEKO
Copy link

QUQNEKO commented Feb 8, 2025

我还有其他2个一起玩这个的创了个群1033162690,我不是大佬,群里有两个懂一些的,大家可以来看看?

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

No branches or pull requests

2 participants