I'm trying to import secure_filename from werkzeug.utils and it shoot an error. It works fine under my base virtual env.
code:
# Flask packages
from flask import Flask, render_template, request, session, redirect, flash, send_file
from flask_bootstrap import Bootstrap
from flask_uploads import UploadSet,configure_uploads,IMAGES,DATA,ALL
# Systems
import os
import sys
import json
from werkzeug.utils import secure_filename
Error:
(absa_annotation) C02QM3FSFVH3:ABSA-annotation-tool kwunkeilau$ python3 app.py
Traceback (most recent call last):
File "app.py", line 4, in <module>
from flask_uploads import UploadSet,configure_uploads,IMAGES,DATA,ALL
File "/Users/kwunkeilau/anaconda3/envs/absa_annotation/lib/python3.7/site-packages/flask_uploads.py", line 26, in <module>
from werkzeug import secure_filename, FileStorage
ImportError: cannot import name 'secure_filename' from 'werkzeug' (/Users/kwunkeilau/anaconda3/envs/absa_annotation/lib/python3.7/site-packages/werkzeug/__init__.py)