我最近重新安装了ubuntu并升级到16.04并且无法使用python:

$ python manage.py runserver

Could not find platform independent libraries

Could not find platform dependent libraries

Consider setting $PYTHONHOME to [:]

Fatal Python error: Py_Initialize: Unable to get the locale encoding

ImportError: No module named 'encodings'

Aborted

此时,python本身不起作用

$ python

Could not find platform independent libraries

Could not find platform dependent libraries

Consider setting $PYTHONHOME to [:]

Fatal Python error: Py_Initialize: Unable to get the locale encoding

ImportError: No module named 'encodings'

Aborted

即使这个建议不再有效:

unset PYTHONHOME

unset PYTHONPATH

每一次我都以一种方式修复它,它又回来了。几个答案有助于暂时解决它,但不是很好。我已经多次重新安装了python和python3。我能从这里做什么?谢谢

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐