如何解决Windows 10 Flask应用程序错误:ModuleNotFoundError:没有名为“ sqlcipher3”的模块
我正在尝试在Windows 10计算机上从Mac重新创建我的开发环境。我有使用Python / Flask API查询已加密的Sqlite DB的Web应用程序。由于出现以下错误(MINGW64),我无法运行此API:
$ flask run
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: While importing "app",an ImportError was raised:
Traceback (most recent call last):
File "c:\users\flaboy\appdata\local\programs\python\python36\lib\site-packages\flask\cli.py",line 240,in locate_app
__import__(module_name)
File "C:\sites\sylwester.tech\api\app.py",line 46,in <module>
from sqlcipher3 import dbapi2 as sqlcipher
ModuleNotFoundError: No module named 'sqlcipher3'
Servername FQDN: ASUSPRO.cl.studentcom.co.uk
Servername HOSTNAME: ASUSPRO
(flask)
flaboy@ASUSP
app.py的第46行
from sqlcipher3 import dbapi2 as sqlcipher
然后我已经安装了sqlcipher3:
$ pip install sqlcipher3
Collecting sqlcipher3
Using cached https://files.pythonhosted.org/packages/cd/3a/8973c035651ad05ca67454813d5612f37f1c49bb75ba18c64ff42c41e7ad/sqlcipher3-0.4.2.tar.gz
Installing collected packages: sqlcipher3
Running setup.py install for sqlcipher3: started
Running setup.py install for sqlcipher3: finished with status 'done'
Successfully installed sqlcipher3
WARNING: You are using pip version 19.2.3,however version 20.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(flask)
并尝试再次运行应用程序,同样的错误
$ pip3 install sqlcipher3
Collecting sqlcipher3
Using cached sqlcipher3-0.4.2.tar.gz (40 kB)
Building wheels for collected packages: sqlcipher3
Building wheel for sqlcipher3 (setup.py): started
Building wheel for sqlcipher3 (setup.py): finished with status 'done'
WARNING: Legacy build of wheel for 'sqlcipher3' created no files.
Command arguments: 'c:\users\flaboy\appdata\local\programs\python\python38\python.exe' -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-54imjh0z\\sqlcipher3\\setup.py'"'"'; __file__='"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-54imjh0z\\sqlcipher3\\setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-wheel-gvkzxuji'
Command output: [use --verbose to show]
Running setup.py clean for sqlcipher3
Failed to build sqlcipher3
DEPRECATION: Could not build wheels for sqlcipher3 which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: sqlcipher3
Running setup.py install for sqlcipher3: started
Running setup.py install for sqlcipher3: finished with status 'done'
Successfully installed sqlcipher3
(flask)
flaboy@ASUSPRO MINGW64 /c/sites/sylwester.tech/api (master)
$ FLASK_APP = app.py烧瓶运行
* Serving Flask app "app.py"
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Usage: flask run [OPTIONS]
Error: While importing "app",in <module>
from sqlcipher3 import dbapi2 as sqlcipher
ModuleNotFoundError: No module named 'sqlcipher3'
Servername FQDN: ASUSPRO.cl.studentcom.co.uk
Servername HOSTNAME: ASUSPRO
(flask)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。