heroku python3:ImportError:没有名为';编码';
我一直在努力让我的工作在heroku上已经有一段时间了,但我一直遇到这个错误:heroku python3:ImportError:没有名为';编码';,python,heroku,encoding,python-3.4,reddit,Python,Heroku,Encoding,Python 3.4,Reddit,我一直在努力让我的工作在heroku上已经有一段时间了,但我一直遇到这个错误: ~ $ python3 Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings' Aborted (core dumped) 当我在远程bash会话中运行python3时(通过heroku-run-bash),就会发生这种情况 heroku日志输出: 20
~ $ python3
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
当我在远程bash
会话中运行python3
时(通过heroku-run-bash
),就会发生这种情况
heroku日志输出:
2015-03-29T09:41:23.669871+00:00 heroku[bot.1]: Starting process with command `python3 allb.py`
2015-03-29T09:41:24.315878+00:00 heroku[bot.1]: State changed from starting to up
2015-03-29T09:41:24.978050+00:00 app[bot.1]: Fatal Python error: Py_Initialize: Unable to get the locale encoding
2015-03-29T09:41:24.978079+00:00 app[bot.1]: ImportError: No module named 'encodings'
2015-03-29T09:41:25.811735+00:00 heroku[bot.1]: State changed from up to crashed
2015-03-29T09:41:25.801807+00:00 heroku[bot.1]: Process exited with status 134
我尝试将运行时设置为3.4,并寻找类似于问题的解决方案。一些消息来源说,$PYTHONPATH
必须为零,$PYTHONPATH
在heroku上的值为/app/
这可能是一个愚蠢的错误,但我找不到它。您需要在runtime.txt文件中指定python版本 然后按下按钮,您将看到: 远程:-->找到python-2.7.13,正在删除
远程:-->安装python-3.6.1最终成功了吗?没有,必须停止使用heroku