[英]gcc 6.3 --> Fatal Python error: Py_Initialize: Unable to get the locale encoding ModuleNotFoundError: No module named 'encodings'
I am trying to install a Python package and I get this error in CentOS7:我正在尝试安装 Python package 并在 CentOS7 中收到此错误:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Complete log is here: https://pastebin.com/raw/xs6zFKVg完整的日志在这里: https://pastebin.com/raw/xs6zFKVg
Here is the package named Kaolin from NVIDIA: https://github.com/NVIDIAGameWorks/kaolin这是来自 NVIDIA 的名为 Kaolin 的 package: https://github.com/NVIDIAGameWorks/kaolin
This error happens after I switch to gcc 6.3 and enter this command: python setup.py install
在我切换到 gcc 6.3 并输入以下命令后发生此错误:
python setup.py install
How should I fix it?我应该如何解决它?
Note that, initially I had GCC 7 and I used the following commands to move onto GCC 6.3 (seems like CUDA had compatability problem with GCC 7 so I had to switch): Note that, initially I had GCC 7 and I used the following commands to move onto GCC 6.3 (seems like CUDA had compatability problem with GCC 7 so I had to switch):
$ sudo yum install devtoolset-6
and和
$ scl enable devtoolset-6 bash
Now I have:我现在有:
$ 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.
I fixed the problem using the following commands:我使用以下命令解决了这个问题:
$ conda create -p /scratch3/3d_pose/kaolin_env python=3.6 numpy cython pytorch-gpu "matplotlib<3.0.0" scikit-image shapely "trimesh>=3.0" scipy sphinx "pytest>=4.6" "pytest-cov>=2.7" tqdm Cython autopep8 flake8
$ conda activate /scratch3/3d_pose/kaolin_env
$ pip install pptk
$ python setup.py install
Still the import kaolin
throws an error even from the.. of kaolin repo.即使来自高岭土回购的..,
import kaolin
仍然会引发错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.