【发布时间】:2020-03-09 22:05:28
【问题描述】:
我正在尝试安装 Python 包,但在 CentOS7 中出现此错误:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
完整的日志在这里:https://pastebin.com/raw/xs6zFKVg
这是来自 NVIDIA 的名为 Kaolin 的软件包:https://github.com/NVIDIAGameWorks/kaolin
在我切换到 gcc 6.3 并输入以下命令后发生此错误:python setup.py install
我应该如何解决它?
请注意,最初我使用的是 GCC 7,然后我使用以下命令转移到 GCC 6.3(似乎 CUDA 与 GCC 7 存在兼容性问题,所以我不得不切换):
$ sudo yum install devtoolset-6
和
$ scl enable devtoolset-6 bash
现在我有:
$ gcc --version
gcc (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3)
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I am not sure if what I did above was the best bet or if this must have caused this new issue.
【问题讨论】:
-
您是否检查过搜索此错误时出现的其他问题,例如this question?
-
所以该修复程序适用于 Windows 10。我的问题出现在 CentOS 7 中。我想知道这是因为切换到 GCC 6 的方式可能不正确吗?