ModuleNotFoundError: No module named 'werkzeug.wrappers.json'

    C:\Anaconda3\python.exe E:/Project/universe/Real-Time-Face-Expression-Recognition-master/main.py
    Traceback (most recent call last):
      File "E:/Project/universe/Real-Time-Face-Expression-Recognition-master/main.py", line 1, in <module>
        from flask import Flask, render_template, Response
      File "C:\Anaconda3\lib\site-packages\flask\__init__.py", line 21, in <module>
        from .app import Flask
      File "C:\Anaconda3\lib\site-packages\flask\app.py", line 69, in <module>
        from .wrappers import Request
      File "C:\Anaconda3\lib\site-packages\flask\wrappers.py", line 14, in <module>
        from werkzeug.wrappers.json import JSONMixin as _JSONMixin
    ModuleNotFoundError: No module named 'werkzeug.wrappers.json'; 'werkzeug.wrappers' is not a package
    
    Process finished with exit code  

     

     

    처음보는 모듈이었지만 일단 모듈을 찾지 못했다고 하니, pip install werkzeug를 하여 설치를 시도해보았다.

     

    (base) E:\Project\universe\Real-Time-Face-Expression-Recognition-master>pip install werkzeug
    Requirement already satisfied: werkzeug in c:\anaconda3\lib\site-packages (0.14.1)

     

    그러나 현재 내 컴터에는 werkzeug가 설치(0.14.1 버전)가 되어 있었다. 

     

    스택오버플로우를 보면 아래의 답변에서 0.15.4를 설치하니 해결이 되었다고 한다.

     

    pip install werkzeug==0.15.4

    (base) E:\Project\universe\Real-Time-Face-Expression-Recognition-master>pip install werkzeug==0.15.4
    Collecting werkzeug==0.15.4
      Downloading Werkzeug-0.15.4-py2.py3-none-any.whl (327 kB)
         |████████████████████████████████| 327 kB 411 kB/s
    Installing collected packages: werkzeug
      Attempting uninstall: werkzeug
        Found existing installation: Werkzeug 0.14.1
        Uninstalling Werkzeug-0.14.1:
          Successfully uninstalled Werkzeug-0.14.1
    Successfully installed werkzeug-0.15.4
    

     

    위와 같이 0.15.4 버전을 설치하니, 에러가 발생하지 않는다. -끝-

     

     

    반응형

    댓글

    Designed by JB FACTORY