我最近重新安装的Ubuntu并没有升级到16.04,不能使用Python:导入错误:没有模块名为“编码”
$ python manage.py runserver
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted
在这一点上,巨蟒本身不工作
$ python
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted
即使这个建议不再有效:
unset PYTHONHOME
unset PYTHONPATH
每一次我修复它,它会再次回来。几个答案有助于暂时修复它,但不是很好。我已经重新安装了python和python3好几次了。我能从这里做什么?谢谢
这是关系到Django还是Python?你可能想用适当的标签编辑你的问题。 –
只是蟒蛇,我碰巧正在使用Django – codyc4321
这似乎是蟒蛇安装不完整。你是否通过apt安装了python,或者你是否从源代码编译并安装了它?运行'哪个python'来检查你在$ PATH中的第一个python二进制文件。 – HAL