TaleLin / lin-cms-flask

🎀A simple and practical CMS implememted by Flask
http://doc.cms.talelin.com/
Other
832 stars 216 forks source link

[BUG] 0.2.x 版本初始化后启动报错:AttributeError: module 'time' has no attribute 'clock' #233

Open Evilmass opened 1 year ago

Evilmass commented 1 year ago

代码版本:0.2.x

python版本:3.9.10

运行环境:virtualenv

复现过程:

virtualenv test
git clone -b 0.2.x https://github.com/TaleLin/lin-cms-flask test
cd test
pip install -r requirements.txt
python starter.py

报错信息:

(test) λ python starter.py
Traceback (most recent call last):
  File "C:\Users\qiyue\Desktop\test\starter.py", line 6, in <module>
    from app.app import create_app
  File "C:\Users\qiyue\Desktop\test\app\app.py", line 11, in <module>
    from lin import Lin
  File "C:\Users\qiyue\Envs\test\lib\site-packages\lin\__init__.py", line 10, in <module>
    from .core import Lin, route_meta, manager
  File "C:\Users\qiyue\Envs\test\lib\site-packages\lin\core.py", line 19, in <module>
    from .db import db
  File "C:\Users\qiyue\Envs\test\lib\site-packages\lin\db.py", line 7, in <module>
    from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy, BaseQuery
  File "C:\Users\qiyue\Envs\test\lib\site-packages\flask_sqlalchemy\__init__.py", line 22, in <module>
    import sqlalchemy
  File "C:\Users\qiyue\Envs\test\lib\site-packages\sqlalchemy\__init__.py", line 9, in <module>
    from .sql import (
  File "C:\Users\qiyue\Envs\test\lib\site-packages\sqlalchemy\sql\__init__.py", line 8, in <module>
    from .expression import (
  File "C:\Users\qiyue\Envs\test\lib\site-packages\sqlalchemy\sql\expression.py", line 34, in <module>
    from .visitors import Visitable
  File "C:\Users\qiyue\Envs\test\lib\site-packages\sqlalchemy\sql\visitors.py", line 28, in <module>
    from .. import util
  File "C:\Users\qiyue\Envs\test\lib\site-packages\sqlalchemy\util\__init__.py", line 8, in <module>
    from .compat import callable, cmp, reduce,  \
  File "C:\Users\qiyue\Envs\test\lib\site-packages\sqlalchemy\util\compat.py", line 234, in <module>
    time_func = time.clock
AttributeError: module 'time' has no attribute 'clock'
sunlin92 commented 1 year ago

你好,可以尝试使用python 3.8版本来运行0.2.x分支代码,由于这是一个项目型框架,老旧分支的依赖无法兼容比较新的python版本。