0

我正在设置数据库的前端以跟踪 Flask 中的剧院服装。用户需要能够上传服装的图片,我正在尝试为此使用 Flask-Uploads。我使用以下两个命令安装了 Flask Uploads 和 Flask Storage:

pip install flask-uploads
pip install flask-storage

它们似乎已正确安装,但它们依赖于 urllib2,它无法正常工作。我不确定如何从下载的应用程序中解决这些依赖错误。错误日志如下。

    File "/srv/http/projects/costumes/costume.wsgi", line 3, in <module>
     from costumeServer import app as application
   File "/srv/http/projects/costumes/costumeServer.py", line 6, in <module>
     from flask.ext.storage import get_default_storage_class
   File "/usr/lib/python3.5/site-packages/flask/exthook.py", line 81, in load_module
     reraise(exc_type, exc_value, tb.tb_next)
   File "/usr/lib/python3.5/site-packages/flask/_compat.py", line 32, in reraise
     raise value.with_traceback(tb)
   File "/usr/lib/python3.5/site-packages/flask_storage/__init__.py", line 17, in <module>
     from ._base import *
   File "/usr/lib/python3.5/site-packages/flask_storage/_base.py", line 13, in <module>
     import urllib2
 ImportError: No module named 'urllib2'

我尝试安装 urllib2

pip install urllib2

但这并没有什么不同。

4

0 回答 0