我正在尝试运行烧瓶运行(在安装Anaconda之前运行良好)的烧瓶应用程序,并且正在获取以下堆栈跟踪
Traceback (most recent call last):
File "C:\Users\Rodrigo\Anaconda3\lib\runpy.py",line 193,in _run_module_as_main
"__main__",mod_spec)
File "C:\Users\Rodrigo\Anaconda3\lib\runpy.py",line 85,in _run_code
exec(code,run_globals)
File "C:\Users\Rodrigo\Documents\Project1\frontEnd\venv\Scripts\flask.exe\__main__.py",line 5,in <module>
File "C:\Users\Rodrigo\Documents\Project1\frontEnd\venv\lib\site-packages\flask\__init__.py",line 19,in <module>
from jinja2 import Markup,escape
File "C:\Users\Rodrigo\Documents\Project1\frontEnd\venv\lib\site-packages\jinja2\__init__.py",line 82,in <module>
_patch_async()
File "C:\Users\Rodrigo\Documents\Project1\frontEnd\venv\lib\site-packages\jinja2\__init__.py",line 78,in _patch_async
from jinja2.asyncsupport import patch_all
File "C:\Users\Rodrigo\Documents\Project1\frontEnd\venv\lib\site-packages\jinja2\asyncsupport.py",line 13,in <module>
import asyncio
File "C:\Users\Rodrigo\Anaconda3\lib\asyncio\__init__.py",line 8,in <module>
from .base_events import *
File "C:\Users\Rodrigo\Anaconda3\lib\asyncio\base_events.py",line 39,in <module>
from . import events
File "C:\Users\Rodrigo\Anaconda3\lib\asyncio\events.py",line 14,in <module>
import contextvars
File "C:\Users\Rodrigo\Anaconda3\lib\contextvars.py",line 1,in <module>
from _contextvars import Context,ContextVar,Token,copy_context
ModuleNotFoundError: No module named '_contextvars'
系统级别的Python版本是3.7.3
venv级别的Python版本是3.7.0
我已经尝试安装contextvars,但是它只升级了旧版本,没有解决问题.在系统级别和venv级别中,contextvars的要求已经满足.
我正在Windows 10上运行它.
关于什么可能导致此的任何想法?
最佳答案
在Windows 7上使用python 3.7.2时遇到相同的问题.
原文链接:https://www.f2er.com/python/533295.html这是一个已知的错误,应解决.
https://bugs.python.org/issue34691
更新至python 3.7.3解决了此问题(对我来说).
尝试将您的venv水平更新为3.7.3