ocean_ctf
ocean_ctf copied to clipboard
请问是否能直接通过python运行main.py文件?
安装好依赖后,使用python3 main.py报错
hsm@HSM ~/D/o/ocean_ctf-main> python3 main.py
INFO [apscheduler.scheduler] Scheduler started
DEBU [apscheduler.scheduler] Looking for jobs to run
DEBU [apscheduler.scheduler] No jobs; waiting until a job is added
INFO [apscheduler.scheduler] Added job "day_upload_req" to job store "default"
DEBU [apscheduler.scheduler] Looking for jobs to run
DEBU [apscheduler.scheduler] Next wakeup is due at 2022-04-13 00:00:00+08:00 (in 41985.317626 seconds)
Traceback (most recent call last):
File "/mnt/c/Users/HSM/Desktop/ocean_ctf-main/ocean_ctf-main/main.py", line 4, in
WSL2 Debain Linux环境
正常docker-compose安装不会出现这种情况,如果是自己安装依赖,请参考dockerfile构建中的方式,在安装requirements后安装指定makeupsafe版本
---原始邮件--- 发件人: @.> 发送时间: 2022年4月12日(周二) 中午12:25 收件人: @.>; 抄送: @.***>; 主题: [tongchengbin/ocean_ctf] 请问是否能直接通过python运行main.py文件? (Issue #25)
安装好依赖后,使用python3 main.py报错 @.*** ~/D/o/ocean_ctf-main> python3 main.py INFO [apscheduler.scheduler] Scheduler started DEBU [apscheduler.scheduler] Looking for jobs to run DEBU [apscheduler.scheduler] No jobs; waiting until a job is added INFO [apscheduler.scheduler] Added job "day_upload_req" to job store "default" DEBU [apscheduler.scheduler] Looking for jobs to run DEBU [apscheduler.scheduler] Next wakeup is due at 2022-04-13 00:00:00+08:00 (in 41985.317626 seconds) Traceback (most recent call last): File "/mnt/c/Users/HSM/Desktop/ocean_ctf-main/ocean_ctf-main/main.py", line 4, in register_blueprints(app) File "/mnt/c/Users/HSM/Desktop/ocean_ctf-main/ocean_ctf-main/app/init.py", line 111, in register_blueprints from app.api.sys.views import bp as admin_bp File "/mnt/c/Users/HSM/Desktop/ocean_ctf-main/ocean_ctf-main/app/api/sys/views.py", line 13, in from app.auth.acls import admin_required File "/mnt/c/Users/HSM/Desktop/ocean_ctf-main/ocean_ctf-main/app/auth/acls.py", line 6, in from app.exceptions import APIForbidden File "/mnt/c/Users/HSM/Desktop/ocean_ctf-main/ocean_ctf-main/app/exceptions.py", line 1, in from markupsafe import text_type ImportError: cannot import name 'text_type' from 'markupsafe' (/home/hsm/.local/lib/python3.9/site-packages/markupsafe/init.py) 不清楚是什么原因造成的?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
建议在requestments.txt中指定MarkupSafe版本号 原因:因MarkupSafe版本较高,导致报错。 解决:降级到MarkupSafe==1.1.1即可,降级方法:pip install setuptools==45.2.0,然后: pip install markupsafe==1.1.1
建议在requestments.txt中指定MarkupSafe版本号 原因:因MarkupSafe版本较高,导致报错。 解决:降级到MarkupSafe==1.1.1即可,降级方法:pip install setuptools==45.2.0,然后: pip install markupsafe==1.1.1
这个是flask的版本问题 当前最新版本已经修复该错误不需要指定markupsafe版本了 使用最新的requirements即可