Skip to content

build failed! File "/usr/lib/python2.7/encodings/__init__.py", line 123 raise CodecRegistryError,\ #93

Description

@andyyuan78

ubgpu@ubgpu:/github/tensorflow$ PYTHONPATH=/usr/lib/python2.7 bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
Fatal Python error: Py_Initialize: Unable to get the locale encoding
File "/usr/lib/python2.7/encodings/init.py", line 123
raise CodecRegistryError,
^
SyntaxError: invalid syntax
Aborted (core dumped)
ubgpu@ubgpu:
/github/tensorflow$

Activity

  1. Foorack commented on Nov 10, 2015

    @Foorack

    I would recommend trying to unset PYTHONPATH. It is generally not needed, and it causes things to break like this. I do not work for Google, just thought that it may help you as I have read about this problem before. 😃

  2. andyyuan78 commented on Nov 10, 2015

    @andyyuan78
    Author

    ubgpu@ubgpu:~/github/tensorflow$ echo $PYTHONPATH

    ubgpu@ubgpu:/github/tensorflow$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
    Fatal Python error: Py_Initialize: Unable to get the locale encoding
    ImportError: No module named 'encodings'
    Aborted (core dumped)
    ubgpu@ubgpu:
    /github/tensorflow$

  3. andyyuan78 commented on Nov 10, 2015

    @andyyuan78
    Author

    solved.

    I forget set the bazel path, also , I install multi version of python

  4. added a commit that references this issue on Jun 28, 2017
  5. velvetcake commented on Aug 13, 2017

    @velvetcake

    @andyyuan78 hi,What was the solution to this? I'm facing the same issue.what‘s the bazel path?

  6. added a commit that references this issue on Dec 13, 2018
  7. ConnieWangYuan commented on Jan 9, 2019

    @ConnieWangYuan

    I met the same error. Please show the solution.

  8. added a commit that references this issue on Oct 4, 2019
    982b36e
  9. added 4 commits that reference this issue on Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions