Brikwerk / nxbt

Control your Nintendo Switch through a website, terminal, or macro.
MIT License
817 stars 100 forks source link

Can't import 'escape' from 'jinja2' #121

Open UnderCurve opened 1 year ago

UnderCurve commented 1 year ago

Hey there so I'm trying to get the web ui to run and I'm just getting this:

user@server:~ $ sudo nxbt webapp
Traceback (most recent call last):
  File "/usr/local/bin/nxbt", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/nxbt/cli.py", line 321, in main
    from .web import start_web_app
  File "/usr/local/lib/python3.9/dist-packages/nxbt/web/__init__.py", line 1, in <module>
    from .app import start_web_app
  File "/usr/local/lib/python3.9/dist-packages/nxbt/web/app.py", line 9, in <module>
    from flask import Flask, render_template, request
  File "/usr/local/lib/python3.9/dist-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
ImportError: cannot import name 'escape' from 'jinja2' (/usr/local/lib/python3.9/dist-packages/jinja2/__init__.py)

and I'm not really sure what to do as I don't know anything about python so yeah please help

ThatOneOcto commented 1 year ago

bump, happening to me too

Apocalypse0 commented 1 year ago

same to me

Dummydud3 commented 1 year ago

I had this problem myself, but i solved it by changing the Flask depencancy version inside of METADATA to 2.2.2

Telain commented 1 year ago

This just gave me another error with the webapp. I ended up needing to go down to: Flask-2.0.3 & Werkzeug-2.0.3

Traceback (most recent call last): File "/usr/local/bin/nxbt", line 8, in sys.exit(main()) File "/usr/local/lib/python3.9/dist-packages/nxbt/cli.py", line 321, in main from .web import start_web_app File "/usr/local/lib/python3.9/dist-packages/nxbt/web/init.py", line 1, in from .app import start_web_app File "/usr/local/lib/python3.9/dist-packages/nxbt/web/app.py", line 10, in from flask_socketio import SocketIO, emit File "/usr/local/lib/python3.9/dist-packages/flask_socketio/init.py", line 24, in from werkzeug.serving import run_with_reloader ImportError: cannot import name 'run_with_reloader' from 'werkzeug.serving' (/usr/local/lib/python3.9/dist-packages/werkzeug/serving.py)

Naibaowjk commented 1 year ago

thank you for ur solution

Dummydud3 commented 1 year ago

@Telain Are you running this on a Virtual Machine or a standard installation?

Telain commented 1 year ago

Standard install, on a rpi4.

Dummydud3 commented 1 year ago

this seems to be a problem with the source code, not being updated to python 3.10, I'm going to make a branch that fixes this soon

Dummydud3 commented 1 year ago

alright so i was able to fix it the long way, this is what i did.

pip install https://github.com/eventlet/eventlet/archive/master.zip

this istalls eventlet. fixes problem 1. but this now leads to another problem.

now run sudo gedit /usr/local/lib/python3.10/dist-packages/dns/namedict.py

go to line 35, and change collections.MutableMappingto instead collections.abc.MutableMapping

Boom! Fixed! this worked for me running Ubuntu 22.04.2.

UnderCurve commented 1 year ago

ok so what I did is I just went through it with chatgpt and yeah I got it working so just try that

Dummydud3 commented 1 year ago

this issue was solved, so i think we can close this issue. @Brikwerk