ProxyURL icon indicating copy to clipboard operation
ProxyURL copied to clipboard

运行python3 main.py出现错误

Open yukigod17 opened this issue 2 years ago • 3 comments

运行python3 main.py后出现以下错误

root@debian-s-1vcpu-512mb-10gb-sgp1-01:~/ProxyURL# python3 main.py Traceback (most recent call last): File "/root/ProxyURL/main.py", line 7, in from app.api import * File "/root/ProxyURL/app/api/init.py", line 15, in from app.conf import * File "/root/ProxyURL/app/conf/init.py", line 1, in from .config import * File "/root/ProxyURL/app/conf/config.py", line 13, in class Config(BaseSettings): NameError: name 'BaseSettings' is not defined

yukigod17 avatar Nov 26 '23 03:11 yukigod17

thankyou

lishangru avatar Nov 26 '23 03:11 lishangru

The same question happened. So how could I solve it?

Viper-express avatar Dec 08 '23 06:12 Viper-express

虽然跑起来了,但是PotPlayer播放不了,APTV可以,但是我还想喜欢PotPlayer对电视插帧,所以没有深入研究,打算放弃这个项目,报错解决方法如下: 新版本BaseSettings换到pydantic-settings包里面去了,所以报错, 包安装 python3 -m pip install pydantic-settings

config.py加入 from pydantic_settings import BaseSettings

替换这几行 VERSION: ClassVar[str] = '1.0' # 使用 ClassVar

ORIGINS: List[str] = ['*'] # 添加类型注解

ROOT: Path = Path('.') # 添加类型注解

LOG_DIR: Path = Path('log') # 添加类型注解

datadir: Path = Path('vtemp') # 添加类型注解

count: int = 0 # 添加类型注解

url_regex: str = r"(http|https)://((?:[\w-]+.)+[a-z0-9]+)((?:/[^/?#]*)+)?(?[^#]+)?(#.+)?"

LztCode avatar Sep 25 '24 07:09 LztCode