我最近重新安装了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

技术共进,成长同行——讯飞AI开发者社区

更多推荐