简体   繁体   中英

I am getting an ImportError in my pythonanywhere and I don't know what it is or how to fix it

This is the error I am getting

I tried going to the links mentioned in the last 3 lines but that was to no avail. They mentioned the things that I already took into account when I saw this error. I tried to uninstall jinja2 and then install jinja2 3.0 as I saw that that could be of help on some other SO post but that did not help. Please help me.

Edit: This is the new error I am getting -

2022-12-13 14:35:34,464: ***************************************************
2022-12-13 14:35:35,696: Error running WSGI application
2022-12-13 14:35:35,696: ImportError: cannot import name 'json' from 'itsdangerous' (/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/itsdangerous/__init__.py)
2022-12-13 14:35:35,697:   File "/var/www/mangagen_pythonanywhere_com_wsgi.py", line 16, in <module>
2022-12-13 14:35:35,697:     from run import app as application  # noqa
2022-12-13 14:35:35,697: 
2022-12-13 14:35:35,697:   File "/home/mangagen/mysite/run.py", line 1, in <module>
2022-12-13 14:35:35,697:     from yff import app, db
2022-12-13 14:35:35,698: 
2022-12-13 14:35:35,698:   File "/home/mangagen/mysite/yff/__init__.py", line 1, in <module>
2022-12-13 14:35:35,698:     from flask import Flask
2022-12-13 14:35:35,698: 
2022-12-13 14:35:35,698:   File "/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/flask/__init__.py", line 21, in <module>
2022-12-13 14:35:35,699:     from .app import Flask, Request, Response
2022-12-13 14:35:35,699: 
2022-12-13 14:35:35,699:   File "/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/flask/app.py", line 26, in <module>
2022-12-13 14:35:35,699:     from . import cli, json
2022-12-13 14:35:35,699: 
2022-12-13 14:35:35,700:   File "/home/mangagen/.virtualenvs/myvirtualenv/lib/python3.10/site-packages/flask/json/__init__.py", line 21, in <module>
2022-12-13 14:35:35,700:     from itsdangerous import json as _json
2022-12-13 14:35:35,700: ***************************************************
2022-12-13 14:35:35,700: If you're seeing an import error and don't know why,
2022-12-13 14:35:35,700: we have a dedicated help page to help you debug: 
2022-12-13 14:35:35,701: https://help.pythonanywhere.com/pages/DebuggingImportError/

I visited the link at the end but that did not help me in any way.

mkvirtualenv myenv --python=/usr/bin/python3.4 $ pip install django

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM