大家好,小白刚知道有这个论坛,发帖可能不太详细。最近学习在pipenv环境使用flask,但是遇到一个百思不得其解的问题,困扰我好久了,麻烦大佬帮忙看看。
首先,如果我用默认的生产环境,则显示:
PS D:\doubanban> 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
- Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
但当我在 .flaskenv 文件中加入 FLASK_ENV=development 环境变量(只有这个变量),想进入开发环境,就显示如下:
PS D:\doubanban> flask run
- Environment: development
- Debug mode: on
- Restarting with windowsapi reloader
c:\users\administrator.virtualenvs\doubanban-n8dj0560\scripts\python.exe: Error while finding module specification for
‘C:\Users\Administrator\.virtualenvs\doubanban-N8DJ0560\Scripts\flask’ (ModuleNotFoundError: No module named ‘C:\Users\Administrator\’)
PS D:\doubanban>
这问题完全查不到资料,自己想了很久也想不通。。最后找到这个论坛,希望有人懂。
以下是pipfile文件内容:
[[source]]
name = “pypi”
url = “https://pypi.tuna.tsinghua.edu.cn/simple/”
verify_ssl = true
[dev-packages]
[packages]
flask = “"
flask-mongoengine = "”
watchdog = “"
flask-wtf = "”
[requires]
python_version = “3.6”
不知道还需要发些什么信息了。。