实际上,我正试图在heroku中部署我的应用程序,而且我总是在heroku的日志中看到这个异常,因为我使用的是python3.6.3
2017-10-09T22:14:05.288072+00:00 heroku[web.1]: State changed from crashed
to starting
2017-10-09T22:14:07.772902+00:00 heroku[web.1]: Starting process with
command `python BookmarkServer.py`
2017-10-09T22:14:10.065235+00:00 app[web.1]: import os.environ
2017-10-09T22:14:10.065239+00:00 app[web.1]: ModuleNotFoundError: No module
named 'os.environ'; 'os' is not a package
2017-10-09T22:14:10.064976+00:00 app[web.1]: Traceback (most recent call
last):
2017-10-09T22:14:10.064990+00:00 app[web.1]: File "BookmarkServer.py",
line 47, in <module>
2017-10-09T22:14:10.158467+00:00 heroku[web.1]: Process exited with status 1
2017-10-09T22:14:10.179803+00:00 heroku[web.1]: State changed from starting
to crashed
os.environ
不是模块。它是os
模块内的一个变量environ
。import
语句只导入模块。使用方法如下:其他用途:
^{pr2}$相关问题 更多 >
编程相关推荐