login|Register
Forum > Python
Post|
看36980|回25|Favorite
oggstar 看全部
2016-10-15 02:46:51
I get this error when I run the script

code:

  1. Traceback (most recent call last):
  2.   File "webioOP.py", line 3, in <module>
  3.     from flask import Flask, render_template, request
  4.   File "/usr/local/lib/python2.7/dist-packages/flask/__init__.py", line 21, in <module>
  5.     from .app import Flask, Request, Response
  6.   File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 27, in <module>
  7.     from . import json, cli
  8.   File "/usr/local/lib/python2.7/dist-packages/flask/json.py", line 23, in <module>
  9.     from itsdangerous import simplejson as _json
  10.   File "/usr/local/lib/python2.7/dist-packages/itsdangerous.py", line 40, in <module>
  11.     import json
  12.   File "/usr/local/lib/python2.7/dist-packages/flask/json.py", line 14, in <module>
  13.     from .globals import current_app, request
  14. ValueError: Attempted relative import in non-package

What am I doing wrong?
nopnop2002 看全部
2016-10-15 22:39:42

quote:

oggstar replied at 2016-10-15 02:46
I get this error when I run the script

What am I doing wrong?

I think that flask not installed.


oggstar 看全部
2016-10-16 07:35:48
No, I was being stupid. It works great now
luferagon 看全部
2016-12-5 08:58:33
Excelente tutorial, Alguien sabrá por qué al momento de correr flask me manda error diciendo que no puede importar flask from Flask?
luferagon 看全部
2016-12-6 03:00:49

quote:

luferagon replied at 2016-12-5 08:58
Excelente tutorial, Alguien sabrá por qué al momento de correr flask me manda error diciendo que n ...

my problem was resolved changing the distribution for lubuntu

OrangePi En

Powered by Discuz! X3.4

homepage|Simple edition|Touch edition|PC