Skip to content

No module named tensorflow.python.platform #36

Description

@wangdelp

when running
python tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py

get the following error:
Traceback (most recent call last):
File "tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py", line 14, in
import tensorflow.python.platform
ImportError: No module named tensorflow.python.platform

Activity

  1. mrry commented on Nov 9, 2015

    @mrry
    Contributor

    For this to work, you'll have to install the PIP package. You can either download the pre-built package, or build from source by following the instructions here: http://tensorflow.org/get_started/os_setup.md#create-pip

  2. wangdelp commented on Nov 9, 2015

    @wangdelp
    Author

    @mrry Thank you. When I run
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

    Mon Nov 9 15:34:49 EST 2015 : === Using tmpdir: /tmp/tmp.itHpiLkuJI
    /tmp/tmp.itHpiLkuJI ~/packages/tensorflow
    Mon Nov 9 15:34:49 EST 2015 : === Building wheel
    Traceback (most recent call last):
    File "setup.py", line 77, in
    keywords='tensorflow tensor machine learning',
    File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
    File "build/bdist.linux-x86_64/egg/setuptools/command/sdist.py", line 48, in run
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 970, in run_command
    cmd_obj = self.get_command_obj(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 845, in get_command_obj
    klass = self.get_command_class(command)
    File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 430, in get_command_class
    File "/usr/lib/python2.7/distutils/dist.py", line 815, in get_command_class
    import (module_name)
    File "/usr/lib/python2.7/distutils/command/check.py", line 13, in
    from docutils.utils import Reporter
    File "/home/xeraph/virtualenv/v1/local/lib/python2.7/site-packages/docutils/utils/init.py", line 20, in
    import docutils.io
    File "/home/xeraph/virtualenv/v1/local/lib/python2.7/site-packages/docutils/io.py", line 18, in
    from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
    File "/home/xeraph/virtualenv/v1/local/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in
    locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
    File "/home/xeraph/virtualenv/v1/lib/python2.7/locale.py", line 543, in getdefaultlocale
    return _parse_localename(localename)
    File "/home/xeraph/virtualenv/v1/lib/python2.7/locale.py", line 475, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
    ValueError: unknown locale: UTF-8

    Any idea?

  3. mrry commented on Nov 9, 2015

    @mrry
    Contributor

    Can you try the following?

    export LC_ALL=en_us.UTF-8
    export LANG=en_us.UTF-8
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
  4. wangdelp commented on Nov 9, 2015

    @wangdelp
    Author

    @mrry it works, Thx.

  5. added a commit that references this issue on Mar 9, 2016
  6. kirai commented on Jul 7, 2016

    @kirai

    I run into the same problem. I use Mac OS X in Japanese.

    export LC_ALL=en_us.UTF-8
    export LANG=en_us.UTF-8
    

    Solved it :)

    But I think en_us.UTF-8 should not be assumed by default on installation.

  7. added a commit that references this issue on Jun 20, 2017
  8. added a commit that references this issue on Sep 28, 2017
  9. qiaohaijun commented on Sep 5, 2018

    @qiaohaijun
    Contributor

    export LC_ALL=en_us.UTF-8
    export LANG=en_us.UTF-8
    bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

    it works, but I dont known why.

  10. added a commit that references this issue on Oct 16, 2019
  11. added a commit that references this issue on Dec 6, 2019
  12. added a commit that references this issue on Feb 1, 2021
  13. added 5 commits that reference this issue on Apr 9, 2025
  14. added 2 commits that reference this issue on Mar 9, 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