oduleNotFoundError:没有名为'操作系统环境'

2024-04-25 21:52:05 发布

您现在位置:Python中文网/ 问答频道 /正文

实际上,我正试图在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

Tags: tofrompyappherokuoswithenviron