相关疑难解决方法(0)

ImportError:没有名为'encodings'的模块

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

83
推荐指数
6
解决办法
14万
查看次数

致命的 Python 错误:init_fs_encoding:尝试启动 uwsgi 时,无法获取文件系统编码的 Python 编解码器

我试图在我的虚拟环境中启动我的 uwsgi 服务器,但是在我添加plugin python3选项后,我每次都会收到此错误:

!!! Python Home is not a directory: /home/env3/educ !!!
Set PythonHome to /home/env3/educ
Python path configuration:
  PYTHONHOME = '/home/env3/educ'
  PYTHONPATH = (not set)
  program name = '/home/env3/educ/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/home/env3/educ/bin/python'
  sys.base_prefix = '/home/env3/educ'
  sys.base_exec_prefix = '/home/env3/educ'
  sys.executable = '/home/env3/educ/bin/python'
  sys.prefix = '/home/env3/educ'
  sys.exec_prefix = '/home/env3/educ'
  sys.path = [
    '/home/env3/educ/lib/python38.zip',
    '/home/env3/educ/lib/python3.8',
    '/home/env3/educ/lib/python3.8/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the …
Run Code Online (Sandbox Code Playgroud)

python django ubuntu uwsgi

11
推荐指数
3
解决办法
7464
查看次数