0

I am trying to install a Python package and I get this error in 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

Here is the package named Kaolin from NVIDIA: https://github.com/NVIDIAGameWorks/kaolin

This error happens after I switch to gcc 6.3 and enter this command: 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):

$ 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.
Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
  • Did you check the other questions that come up if you search for this error, like [this question](https://stackoverflow.com/questions/42512817/fatal-python-error-on-windows-10-modulenotfounderror-no-module-named-encodings)? – user2357112 Nov 14 '19 at 02:25
  • so the fix is for Windows 10. My problem arises in CentOS 7. I wonder this happened due to the potential not proper way of switching to GCC 6? – Mona Jalal Nov 14 '19 at 02:31

1 Answers1

0

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.

Mona Jalal
  • 34,860
  • 64
  • 239
  • 408