我最近重新安装了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
Run Code Online (Sandbox Code Playgroud)
此时,python本身不起作用
$ 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
Run Code Online (Sandbox Code Playgroud)
即使这个建议不再有效:
unset …Run Code Online (Sandbox Code Playgroud) python development-environment virtualenv python-3.x macos-catalina