Tensorflow: Python 3.7 compatibility

Created on 3 Jul 2018  ·  80Comments  ·  Source: tensorflow/tensorflow

I'm sure developers are working hard to catch up with Python 3.7.
Is there any timeline?

pip3 install tensorflow - apparently does not work, building from source:

OS Platform and Distribution: Mac OS X 10.13.5
Python: Python 3.7.0 (Homebrew)
TensorFlow installed from: source (https://github.com/tensorflow/tensorflow.git)
TensorFlow version: TensorFlow 1.9.0-rc2
Bazel version:

Build label: 0.15.0-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jun 26 12:42:27 2018 (1530016947)
Build timestamp: 1530016947
Build timestamp as int: 1530016947

CUDA/cuDNN version: None
GPU model and memory: None
Exact command to reproduce:
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

Starting local Bazel server and connecting to it...
...........................
WARNING: /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/BUILD:1992:1: in srcs attribute of cc_library rule @grpc//:grpc_nanopb: please do not import '@grpc//third_party/nanopb:pb_common.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/BUILD:1992:1: in srcs attribute of cc_library rule @grpc//:grpc_nanopb: please do not import '@grpc//third_party/nanopb:pb_decode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/BUILD:1992:1: in srcs attribute of cc_library rule @grpc//:grpc_nanopb: please do not import '@grpc//third_party/nanopb:pb_encode.c' directly. You should either move the file to this package or depend on an appropriate rule there. Since this rule was created by the macro 'grpc_generate_one_off_targets', the error might have been caused by the macro implementation in /private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/grpc/bazel/grpc_build_system.bzl:172:12
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/learn/BUILD:17:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': No longer supported. Switch to SavedModel immediately.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/learn/BUILD:17:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:gc': No longer supported. Switch to SavedModel immediately.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/timeseries/python/timeseries/BUILD:356:1: in py_library rule //tensorflow/contrib/timeseries/python/timeseries:ar_model: target '//tensorflow/contrib/timeseries/python/timeseries:ar_model' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/timeseries/python/timeseries/state_space_models/BUILD:73:1: in py_library rule //tensorflow/contrib/timeseries/python/timeseries/state_space_models:kalman_filter: target '//tensorflow/contrib/timeseries/python/timeseries/state_space_models:kalman_filter' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/timeseries/python/timeseries/state_space_models/BUILD:230:1: in py_library rule //tensorflow/contrib/timeseries/python/timeseries/state_space_models:filtering_postprocessor: target '//tensorflow/contrib/timeseries/python/timeseries/state_space_models:filtering_postprocessor' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/bayesflow/BUILD:17:1: in py_library rule //tensorflow/contrib/bayesflow:bayesflow_py: target '//tensorflow/contrib/bayesflow:bayesflow_py' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/seq2seq/BUILD:23:1: in py_library rule //tensorflow/contrib/seq2seq:seq2seq_py: target '//tensorflow/contrib/seq2seq:seq2seq_py' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/kfac/python/ops/BUILD:80:1: in py_library rule //tensorflow/contrib/kfac/python/ops:loss_functions: target '//tensorflow/contrib/kfac/python/ops:loss_functions' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
WARNING: /Users/zardoz/Projects/tensorflow/tensorflow/contrib/BUILD:14:1: in py_library rule //tensorflow/contrib:contrib_py: target '//tensorflow/contrib:contrib_py' depends on deprecated target '//tensorflow/contrib/distributions:distributions_py': TensorFlow Distributions has migrated to TensorFlow Probability (https://github.com/tensorflow/probability). Deprecated copies remaining in tf.contrib.distributions are unmaintained, unsupported, and will be removed by late 2018. You should update all usage of `tf.contrib.distributions` to `tfp.distributions`.
INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (303 packages loaded).
INFO: Found 1 target...
INFO: From Linking external/grpc/libgrpc_base_c.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(endpoint_pair_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(endpoint_pair_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(ev_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(fork_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(gethostname_fallback.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(gethostname_host_name_max.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(iocp_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(iomgr_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(pollset_set_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(pollset_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(pollset_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(resolve_address_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(socket_utils_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(socket_utils_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(socket_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_client_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_server_utils_posix_noifaddrs.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_server_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(tcp_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(timer_uv.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(unix_sockets_posix_noop.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc_base_c.a(wakeup_fd_eventfd.o) has no symbols
INFO: From Linking external/grpc/libalts_util.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libalts_util.a(check_gcp_environment_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libalts_util.a(check_gcp_environment_windows.o) has no symbols
INFO: From Linking external/grpc/libtsi.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libtsi.a(ssl_session_openssl.o) has no symbols
INFO: From Linking external/grpc/libgrpc++_base.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgrpc++_base.a(rpc_method.o) has no symbols
INFO: From Linking external/grpc/libgpr_base.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(cpu_iphone.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(cpu_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(cpu_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(env_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(env_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(log_android.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(log_linux.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(log_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(string_util_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(string_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(sync_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(time_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(tls_pthread.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(tmpfile_msys.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(tmpfile_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(wrap_memcpy.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(thd_windows.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/libgpr_base.a(stap_timers.o) has no symbols
INFO: From Linking external/grpc/third_party/address_sorting/libaddress_sorting.a [for host]:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: bazel-out/host/bin/external/grpc/third_party/address_sorting/libaddress_sorting.a(address_sorting_windows.o) has no symbols
ERROR: /Users/zardoz/Projects/tensorflow/tensorflow/python/BUILD:5315:1: Executing genrule //tensorflow/python:framework/fast_tensor_util.pyx_cython_translation failed (Exit 1)
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/execroot/org_tensorflow/bazel-out/host/bin/external/cython/cython_binary.runfiles/cython/cython.py", line 17, in <module>
    main(command_line = 1)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 720, in main
    result = compile(sources, options)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 695, in compile
    return compile_multiple(source, options)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 666, in compile_multiple
    context = options.create_context()
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 590, in create_context
    self.cplus, self.language_level, options=self)
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Main.py", line 75, in __init__
    from . import Builtin, CythonScope
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/CythonScope.py", line 5, in <module>
    from .UtilityCode import CythonUtilityCode
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/UtilityCode.py", line 3, in <module>
    from .TreeFragment import parse_from_strings, StringParseContext
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/TreeFragment.py", line 17, in <module>
    from .Visitor import VisitorTransform
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/Visitor.py", line 15, in <module>
    from . import ExprNodes
  File "/private/var/tmp/_bazel_zardoz/5e080a8a46c0e2b2146c013eb1079337/external/cython/Cython/Compiler/ExprNodes.py", line 2875
    await = None
          ^
SyntaxError: invalid syntax
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 179.318s, Critical Path: 6.38s
INFO: 413 processes: 413 local.
FAILED: Build did NOT complete successfully
feature

Most helpful comment

@activatedgeek Pardon me, but I fail to see how downgrading answers the the OP question regarding the timeline of making Tensorflow compatible with Python 3.7 (released almost a month ago).

All 80 comments

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
Have I written custom code
OS Platform and Distribution
TensorFlow installed from
TensorFlow version
Bazel version
CUDA/cuDNN version
GPU model and memory
Exact command to reproduce

Updated the original post as requested.

@homofortis You could use this meanwhile with Homebrew to downgrade your Python version.

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb

async and await are now keywords and need to be replaced in the TF codebase. See https://docs.python.org/3/whatsnew/3.7.html#summary-release-highlights

17022

@activatedgeek Pardon me, but I fail to see how downgrading answers the the OP question regarding the timeline of making Tensorflow compatible with Python 3.7 (released almost a month ago).

@homofortis Apologies. I probably missed a few words in there and thought that your main objective was to compile from source. A lot of searches were leading to this issue, I thought it would be good for everyone who's looking to just run Tensorflow.

As I see from description diagnostics is not related to tensorflow compatibility with Python-3.7 but with usage of too old Cython and currently exactly this issue is not reproducing because Cython mentioned in Bazel workspace is new enough. On the other hand there are at least 2 Python-3.7 compatibility issues:

  • usage of async keyword as variable name in pywrap_tensorflow_internal.py generated from tensorflow/c/eager/c_api.{h,cc} - #20690
  • and breakage caused by change PyUnicode_AsUTF8AndSize()'s return type from char * to const char *
    Maybe it would be better to put the latter to separate issue.

FWIW, I just built (not tested yet) tensorflow 1.9 with MKL on Windows for Python 3.7 using VS2017 and the following patch:

diff --git a/tensorflow/c/eager/c_api.h b/tensorflow/c/eager/c_api.h
index 1862af3ce2..093b97110f 100644
--- a/tensorflow/c/eager/c_api.h
+++ b/tensorflow/c/eager/c_api.h
@@ -76,7 +76,7 @@ typedef enum TFE_ContextDevicePlacementPolicy {
 // Sets the default execution mode (sync/async). Note that this can be
 // overridden per thread using TFE_ContextSetAsyncForThread.
 TF_CAPI_EXPORT extern void TFE_ContextOptionsSetAsync(TFE_ContextOptions*,
-                                                      unsigned char async);
+                                                      unsigned char is_async);

 TF_CAPI_EXPORT extern void TFE_ContextOptionsSetDevicePlacementPolicy(
     TFE_ContextOptions*, TFE_ContextDevicePlacementPolicy);
@@ -125,7 +125,7 @@ TFE_ContextGetDevicePlacementPolicy(TFE_Context*);

 // Overrides the execution mode (sync/async) for the current thread.
 TF_CAPI_EXPORT extern void TFE_ContextSetAsyncForThread(TFE_Context*,
-                                                        unsigned char async,
+                                                        unsigned char is_async,
                                                         TF_Status* status);

 // Causes the calling thread to block till all ops dispatched in async mode
diff --git a/tensorflow/core/platform/windows/port.cc b/tensorflow/core/platform/windows/port.cc
index 174f41a993..b06434620e 100644
--- a/tensorflow/core/platform/windows/port.cc
+++ b/tensorflow/core/platform/windows/port.cc
@@ -57,6 +57,11 @@ int NumSchedulableCPUs() {
   return system_info.dwNumberOfProcessors;
 }

+int NumHyperthreadsPerCore() {
+  static const int ht_per_core = tensorflow::port::CPUIDNumSMT();
+  return (ht_per_core > 0) ? ht_per_core : 1;
+}
+
 void* AlignedMalloc(size_t size, int minimum_alignment) {
 #ifdef TENSORFLOW_USE_JEMALLOC
   void* ptr = NULL;
diff --git a/tensorflow/python/eager/pywrap_tfe_src.cc b/tensorflow/python/eager/pywrap_tfe_src.cc
index 6c9481c3af..13edbb07db 100644
--- a/tensorflow/python/eager/pywrap_tfe_src.cc
+++ b/tensorflow/python/eager/pywrap_tfe_src.cc
@@ -813,7 +813,7 @@ char* TFE_GetPythonString(PyObject* o) {
   }
 #if PY_MAJOR_VERSION >= 3
   if (PyUnicode_Check(o)) {
-    return PyUnicode_AsUTF8(o);
+    return (char *)PyUnicode_AsUTF8(o);
   }
 #endif
   return nullptr;
diff --git a/tensorflow/python/lib/core/ndarray_tensor.cc b/tensorflow/python/lib/core/ndarray_tensor.cc
index 9df38d464c..4150fbfdd4 100644
--- a/tensorflow/python/lib/core/ndarray_tensor.cc
+++ b/tensorflow/python/lib/core/ndarray_tensor.cc
@@ -154,7 +154,7 @@ Status PyBytesArrayMap(PyArrayObject* array, F f) {
     if (PyUnicode_Check(item.get())) {
 #if PY_VERSION_HEX >= 0x03030000
       // Accept unicode by converting to UTF-8 bytes.
-      ptr = PyUnicode_AsUTF8AndSize(item.get(), &len);
+      ptr = (char *)PyUnicode_AsUTF8AndSize(item.get(), &len);
       if (!ptr) {
         return errors::Internal("Unable to get element as UTF-8.");
       }
diff --git a/tensorflow/python/lib/core/py_func.cc b/tensorflow/python/lib/core/py_func.cc
index 30c1a9c759..231a66de59 100644
--- a/tensorflow/python/lib/core/py_func.cc
+++ b/tensorflow/python/lib/core/py_func.cc
@@ -322,7 +322,7 @@ Status ConvertNdarrayToTensor(PyObject* obj, Tensor* ret) {
         Py_ssize_t el_size;
         if (PyBytes_AsStringAndSize(input_data[i], &el, &el_size) == -1) {
 #if PY_MAJOR_VERSION >= 3
-          el = PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
+          el = (char *)PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
 #else
           el = nullptr;
           if (PyUnicode_Check(input_data[i])) {

I prefer to add the const qualifier to the target instead of removing it from from the result of PyUnicode_AsUTF8AndSize(). This is a constant string, and it should not be modified.

@asimshankar says that he's been reviewing and sending PRs on this topic. I'll assign him.

I'm facing similar issues when building from source too, using python 3.7 in Arch Linux.

ERROR: /home/rharish/.cache/bazel/_bazel_rharish/5d4d7b1255c710f6c814ab2f3f084405/external/protobuf_archive/BUILD:659:1: C++ compilation of rule '@protobuf_archive//:python/google/protobuf/pyext/_message.so' failed (Exit 1): crosstool_wrapper_driver_is_not_gcc failed: error executing command 
  (cd /home/rharish/.cache/bazel/_bazel_rharish/5d4d7b1255c710f6c814ab2f3f084405/execroot/org_tensorflow && \
  exec env - \
    LD_LIBRARY_PATH=:/usr/local/lib:/opt/cuda/lib64 \
    PATH=/home/rharish/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl \
    PWD=/proc/self/cwd \
  external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/host/bin/external/protobuf_archive/_objs/python/google/protobuf/pyext/_message.so/descriptor_containers.pic.d '-frandom-seed=bazel-out/host/bin/external/protobuf_archive/_objs/python/google/protobuf/pyext/_message.so/descriptor_containers.pic.o' -iquote external/protobuf_archive -iquote bazel-out/host/genfiles/external/protobuf_archive -iquote bazel-out/host/bin/external/protobuf_archive -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -iquote bazel-out/host/bin/external/bazel_tools -iquote external/local_config_python -iquote bazel-out/host/genfiles/external/local_config_python -iquote bazel-out/host/bin/external/local_config_python -isystem external/protobuf_archive/python -isystem bazel-out/host/genfiles/external/protobuf_archive/python -isystem bazel-out/host/bin/external/protobuf_archive/python -isystem external/protobuf_archive/src -isystem bazel-out/host/genfiles/external/protobuf_archive/src -isystem bazel-out/host/bin/external/protobuf_archive/src -isystem external/local_config_python/python_include -isystem bazel-out/host/genfiles/external/local_config_python/python_include -isystem bazel-out/host/bin/external/local_config_python/python_include '-std=c++11' -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fPIC -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -fno-omit-frame-pointer -no-canonical-prefixes -DNDEBUG -g0 -O2 -ffunction-sections -fdata-sections -g0 '-march=native' -g0 -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Wno-unused-function -Wno-writable-strings '-DGOOGLE_PROTOBUF_HAS_ONEOF=1' '-DPROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS=1' -c external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc -o bazel-out/host/bin/external/protobuf_archive/_objs/python/google/protobuf/pyext/_message.so/descriptor_containers.pic.o)
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc: In function 'bool google::protobuf::python::descriptor::_GetItemByKey(google::protobuf::python::PyContainer*, PyObject*, const void**)':
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:69:45: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
        ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:172:13: note: in expansion of macro 'PyString_AsStringAndSize'
         if (PyString_AsStringAndSize(key, &name, &name_size) < 0) {
             ^~~~~~~~~~~~~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:69:45: error: invalid conversion from 'const char*' to 'char*' [-fpermissive]
        ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
                      ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
external/protobuf_archive/python/google/protobuf/pyext/descriptor_containers.cc:189:13: note: in expansion of macro 'PyString_AsStringAndSize'
         if (PyString_AsStringAndSize(key, &camelcase_name, &name_size) < 0) {
             ^~~~~~~~~~~~~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-writable-strings'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 63.634s, Critical Path: 9.08s
INFO: 464 processes: 464 local.
FAILED: Build did NOT complete successfully

My system configuration is:
OS Platform and Distribution: Arch Linux
Python: Python 3.7.0
TensorFlow installed from: source (https://github.com/tensorflow/tensorflow.git), master branch
TensorFlow version: TensorFlow 1.9.0
Bazel version: 0.16.0
CUDA/cuDNN version: CUDA 9.2
GPU model and memory: NVIDIA GeForce GTX 960M, 4GB

@bstriner has volunteered to update #21202 which will take us one step further. But it seems that we'll need to wait for a protobuf release with support for Python 3.7 and then update TensorFlow dependencies to use that new protobuf version.

@rharish101
If you are using Arch Linux, you can install Tensorflow with pacman-S python-tensorflow.

@rharish101
If you need CUDA support, you can install pacman-S python-tensorflow-cuda

@hzxie Yup, it works well now! How did Arch's guys get it to work?

No protobuf release yet supports 3.7 but if you're willing to use a snapshot from master then you can build TF for 3.7

@bstriner
I still cannot compile the latest master. The build exits with errors.

OS Platform and Distribution: Mac OS X 10.13.5
Python: Python 3.7.0
TensorFlow installed from: source (https://github.com/tensorflow/tensorflow.git)
TensorFlow version: TensorFlow 1.10
Bazel version: 0.15.2-homebrew
CUDA/cuDNN version: None
GPU model and memory: None
Exact command to reproduce:
bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package

ERROR: /Users/zardoz/Projects/tensorflow/tensorflow/python/eager/BUILD:10:1: C++ compilation of rule '//tensorflow/python/eager:pywrap_tfe_lib' failed (Exit 1)
tensorflow/python/eager/pywrap_tfe_src.cc:219:11: error: cannot initialize a variable of type 'char *' with an rvalue of type 'const char *'
    char* buf = PyUnicode_AsUTF8AndSize(py_value, &size);
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tensorflow/python/eager/pywrap_tfe_src.cc:834:12: error: cannot initialize return object of type 'char *' with an rvalue of type 'const char *'
    return PyUnicode_AsUTF8(o);
           ^~~~~~~~~~~~~~~~~~~
2 errors generated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 5896.213s, Critical Path: 267.71s
INFO: 2883 processes: 2883 local.
FAILED: Build did NOT complete successfully

@cgohlke How to build tensorflow-gpu for python 3.7?

@homofortis that's because this pr isn't merged yet. You need to pull it in yourself. https://github.com/tensorflow/tensorflow/pull/21202

To pull py37 fixes into your current repo, something like this:

git remote add bstriner https://github.com/bstriner/tensorflow.git
git fetch bstriner
git merge bstriner/py37

Basically, if you see issues with const char * being cast to char * or something similar, that is the changes in py37. Fix and discussion in the linked PR.

@bstriner I need a wheel file of tensorflow gpu for python 3.7. I cant build it by myself

When is this issue fixed??

Thanks to @bstriner 's contribution (PR #21202), we should be able to build for Python 3.7 now. However, as he's alluded to in the PR, the eigen and protobuf libraries still need a fix to compile on Windows.

@gunan @angersson would know about whether the official release of TensorFlow 1.11 will support Python 3.7, or if you'll have to compile from source.

We still have a problem on the infra side we need to figure out.
All of our build infra uses ubuntu 14, due to community requests (to be compatible with ubuntu 14).
However, python 3.7 is not straightforward to build on ubuntu 14, since it needs updated versions of a few libraries that come with ubuntu.

While we wait for eigen and protobuf fixes on windows, we will resolve those.
But this means 1.11 wont have a prebuilt package for python 3.7

@SukeshP1995 You may try this url https://www.lfd.uci.edu/~gohlke/pythonlibs/#tensorflow

Are the any Ubuntu 16.04 TensorFlow gpu wheels for python 3.7 available? Or, if not, could I please get a short guide for building it myself? I don't have the experience to just go outand do it without anyone holding my hand :)

@morenoh149 that is only for python 3.6. I have 3.7 because I just did a fresh install.

https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-418442189 still applies.
In addition to infra issues (python 3.7 on ubuntu 14) not all of our dependencies have python 3.7 support yet. So we are still working with them to move to python 3.7.

ah no, that's the fundamental problem @bjtho08 tensorflow needs to stop using the new python keywords in 3.7. That's what this thread is about. In the meantime you can use the pending forks or use 3.6

@morenoh149 so my options are to build an older version of python or building tensorflow from git/master?

as of today yes. This PR https://github.com/tensorflow/tensorflow/pull/21202 is on master but a release hasn't been cut yet. FWIW you can use pyenv to install many python versions on a system. A professional software engineer should be able to pin their dependencies and tools depending on the project.

@morenoh149 @bjtho08 building tensorflow from master branch isn't enough. Some dependecies still don't support 3.7 yet.

@adrianodennanni the dependencies support 3.7, but not in released versions. You need to change the libraries in the workspace to the current masters. Can't change the dependencies in tensorflow until those libraries have stable releases.

So, for current protobuf, use this:

    PROTOBUF_URLS = [
        "https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz",
        "https://github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz",
    ]
    PROTOBUF_SHA256 = "f785d2009ea7c8484cb0443d9db8fe55f73cfdb6e112bfa659a8a5cdaf664ccd"
    PROTOBUF_STRIP_PREFIX = "protobuf-a6e1cc7e328c45a0cb9856c530c8f6cd23314163"

You might also need latest eigen.

@rharish101
If you need CUDA support, you can install pacman-S python-tensorflow-cuda

well done thanks

as of today yes. This PR #21202 is on master but a release hasn't been cut yet. FWIW you can use pyenv to install many python versions on a system. A professional software engineer should be able to pin their dependencies and tools depending on the project.

Thanks for the tip, @morenoh149 ! I made it work by starting over using pyenv and CUDA 9.0 :)

@gunan

However, python 3.7 is not straightforward to build on ubuntu 14, since it needs updated versions of a few libraries that come with ubuntu.

I'd like to share my experience in building Python-3.7 on Ubuntu 12, and I hope it will help if you haven't solved that issue yet. I build using following configure flags:

    --prefix=... \
    --enable-ipv6 \
    --with-dbmliborder=gdbm \
    --with-system-expat \
    --with-computed-gotos \
    --with-system-ffi \
    --with-ensurepip=no

And the only system library too outdated for Python was OpenSSL, thus ssl module cannot be built. To solve the issue I decided to build OpenSSL from source and link it statically using cryptography recipe (https://cryptography.io/en/latest/installation/#static-wheels):

  • build properly configured OpenSSL with only static libs:
OPENSSL_VERSION=1.0.2p
wget https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
tar xf openssl-${OPENSSL_VERSION}.tar.gz
cd openssl-${OPENSSL_VERSION}
./config no-shared no-ssl2 no-ssl3 -fPIC --prefix=$(pwd)/_openssl
make && make install
  • build Python using that OpenSSL by passing flag to configure script: --with-openssl=$(pwd)/openssl-${OPENSSL_VERSION}/_openssl, so configure invocation looks like:
./configure
    --prefix=... \
    --enable-ipv6 \
    --with-dbmliborder=gdbm \
    --with-system-expat \
    --with-computed-gotos \
    --with-system-ffi \
    --with-ensurepip=no \
    --with-openssl=$(pwd)/openssl-${OPENSSL_VERSION}/_openssl

Besides outdated OpenSSL issue I haven't met problems building Python-3.7 on old Ubuntu, I tested my build and it seems to work properly, tests from Python source pass.

Nagging Assignees @gunan, @angersson: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@bstriner you suggested changing PROTOBUF_URLS, PROTOBUF_SHA256 and PROTOBUF_STRIP_PREFIX. I assume you do this in tensorflow/workspace.bzl? Anywhere else? Thanks.

Actually, after trying this, bazel build of tensorflow 1.11 results in:

ERROR: tensorflow/tensorflow/tools/pip_package/BUILD:216:1: error loading package 'tensorflow': Extension file not found. Unable to load package for '@bazel_skylib//:lib.bzl': The repository could not be resolved and referenced by '//tensorflow/tools/pip_package:build_pip_package'

@jeffcbecker I also got this problem. It seems that the URL https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz is not avaliable. Anyone got a workaround for this?

I was able to work around by using Python 3.6.
Cheers
Jeff
Sent from my T-Mobile 4G LTE Device
-------- Original message --------From: Adriano Dennanni notifications@github.com Date: 10/21/18 1:40 PM (GMT-08:00) To: tensorflow/tensorflow tensorflow@noreply.github.com Cc: jeffcbecker jeff.c.becker@gmail.com, Mention mention@noreply.github.com Subject: Re: [tensorflow/tensorflow] Python 3.7 compatibility (#20517)
@jeffcbecker I also got this problem. It seems that the URL https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz is not avaliable. Anyone got a workaround for this?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/tensorflow/tensorflow","title":"tensorflow/tensorflow","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/tensorflow/tensorflow"}},"updates":{"snippets":[{"icon":"PERSON","message":"@adrianodennanni in #20517: @jeffcbecker I also got this problem. It seems that the URL https://mirror.bazel.build/github.com/google/protobuf/archive/a6e1cc7e328c45a0cb9856c530c8f6cd23314163.tar.gz is not avaliable. Anyone got a workaround for this?"}],"action":{"name":"View Issue","url":"https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-431701713"}}}
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-431701713",
"url": "https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-431701713",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [tensorflow/tensorflow] Python 3.7 compatibility (#20517)",
"sections": [
{
"text": "",
"activityTitle": "Adriano Dennanni",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@adrianodennanni",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{n"commandName": "IssueComment",n"repositoryFullName": "tensorflow/tensorflow",n"issueId": 20517,n"IssueComment": "{{IssueComment.value}}"n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{n"commandName": "IssueClose",n"repositoryFullName": "tensorflow/tensorflow",n"issueId": 20517n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/tensorflow/tensorflow/issues/20517#issuecomment-431701713"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{n"commandName": "MuteNotification",n"threadId": 352548653n}"
}
],
"themeColor": "26292E"
}
]

protobuf wheel have been upgraded to support 3.7.

Now it is time to release tensorflow for 3.7 support.

Great news!
Would you like to send a PR to bump TF protobuf dependencies in workspace and setup.py?

Tensorflow is apparently the last missing piece of Python-3.7.1. It may have an impact on some Cloud Electric bill as Python-3.7 is more efficient than Python-3.6.

https://github.com/fo40225/tensorflow-windows-wheel/tree/master/1.12.0/py37

For anyone who wants to test tensorflow 1.12.0 with python 3.7 on windows.

depands on protobuf v3.6.0 + cherry-pick https://github.com/protocolbuffers/protobuf/commit/0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7

It's been months since 3.7 release, updates for TF are still rolling out, so what is the word/ETA on compatibility?

So the year of 2018 is coming to an end, and the official python 3.7 supported release is still a bubble? :)

The version posted by @adrianodennanni works for me. I'm using python3.7 features in my code and it's a real hustle to switch environments all the time.

For what it's worth, I was able to compile tf and build a Python3.7 wheel on OSX using the current master.

I've submitted https://github.com/tensorflow/tensorflow/commit/b0d7d8a477d3041e2d0ebd0cb1d35e4a7fa09663 which should allow you to build for 3.7. tf-nightly now has a CPU (Ubuntu only) version that only works on Ubuntu16.04+. GPU version for Ubuntu coming shortly.

@av8ramit

thanks to you, I've just successfully built tf with python 3.7.1, cuda 10, and cudnn 7.4

now only bazel 0.20 support is left

tf-nightly-gpu builds with CUDA 10 are also on pypi now. I'll keep this bug open until we have an official Python3.7 release build.

@alanpurple can you elaborate? I cant build tf 1.12 to save my life on Ubuntu 18 and python 3.7

On windows:
successfully builded 1.12-cpu, and imported in py3.7.
but gpu:
ps: using bazel 0.21

INFO: From Linking tensorflow/contrib/tpu/python/ops/_tpu_ops.so:
   Creating library bazel-out/x64_windows-opt/bin/tensorflow/contrib/tpu/python/ops/python/ops/lib_tpu_ops.so.ifso and object bazel-out/x64_windows-opt/bin/tensorflow/contrib/tpu/python/ops/python/ops/lib_tpu_ops.so.exp
INFO: From Linking tensorflow/contrib/tensor_forest/python/ops/_stats_ops.so:
   Creating library bazel-out/x64_windows-opt/bin/tensorflow/contrib/tensor_forest/python/ops/python/ops/lib_stats_ops.so.ifso and object bazel-out/x64_windows-opt/bin/tensorflow/contrib/tensor_forest/python/ops/python/ops/lib_stats_ops.so.exp
ERROR: C:/tensorflow/tensorflow/python/keras/api/BUILD:28:1: Executing genrule //tensorflow/python/keras/api:keras_python_api_gen_compat_v1 failed (Exit 1): bash.exe failed: error executing command
  cd C:/users/USER/_bazel_USER/xv6zejqw/execroot/org_tensorflow
  SET CUDA_TOOLKIT_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0
    SET CUDNN_INSTALL_PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0
    SET PATH=C:\msys64\usr\bin;C:\msys64\bin
    SET PYTHON_BIN_PATH=C:/Program Files/Python37/python.exe
    SET PYTHON_LIB_PATH=C:/Program Files/Python37/lib/site-packages
    SET TF_CUDA_CLANG=0
    SET TF_CUDA_COMPUTE_CAPABILITIES=3.5,7.0
    SET TF_CUDA_VERSION=10.0
    SET TF_CUDNN_VERSION=7
    SET TF_NEED_CUDA=1
    SET TF_NEED_OPENCL_SYCL=0
    SET TF_NEED_ROCM=0
  C:/msys64/usr/bin/bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; bazel-out/x64_windows-opt/bin/tensorflow/python/keras/api/create_tensorflow.python_api_1_keras_python_api_gen_compat_v1.exe  --apidir=bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api_v1/ --apiname=keras --apiversion=1  --package=tensorflow.python,tensorflow.python.keras --output_package=tensorflow.python.keras.api._v1 bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/activations/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/densenet/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/inception_resnet_v2/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/inception_v3/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/mobilenet/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/mobilenet_v2/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/nasnet/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/resnet50/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/vgg16/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/vgg19/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/applications/xception/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/backend/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/callbacks/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/constraints/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/boston_housing/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/cifar10/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/cifar100/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/fashion_mnist/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/imdb/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/mnist/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/datasets/reuters/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/estimator/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/experimental/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/initializers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/layers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/losses/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/metrics/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/models/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/optimizers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/image/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/sequence/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/preprocessing/text/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/regularizers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/utils/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/wrappers/__init__.py bazel-out/x64_windows-opt/genfiles/tensorflow/python/keras/api/_v1/keras/wrappers/scikit_learn/__init__.py
Execution platform: @bazel_tools//platforms:host_platform
Traceback (most recent call last):
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Program Files\Python37\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Program Files\Python37\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\tools\api\generator\create_python_api.py", line 27, in <module>
    from tensorflow.python.tools.api.generator import doc_srcs
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "\\?\C:\Users\USER\AppData\Local\Temp\Bazel.runfiles_ms8gr8rl\runfiles\org_tensorflow\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Program Files\Python37\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Program Files\Python37\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 2602.108s, Critical Path: 565.09s
INFO: 4691 processes: 4691 local.
FAILED: Build did NOT complete successfully

Let me tell you what issue I faced and how I resolved them. I am using Mac OS

Tensorflow is not compatible with python 3.7 its only available for i think upto python 3.6 as of now..

I was using python 3.7 so I download python 3.6 from its official website.. a installer package and install it. And pin the python 3.6 app to dock because as soon as python 3.7 is in the launcher. Python 3.6 will not show.. even though it will show on application tab as a secondary folder

Now open terminal and type: nano .bash_profile
Then a nano editor will open uncomment the path for python 3.6 and comment the path for 3.7. then press control+X then y for yes and then Enter

Afterdat restart the terminal and type: echo $PATH
Make sure the first link is of python 3.6

Now type: python3 and hit enter and check which version is opening just to double sure that is python 3.6

Now type: python3 -m pip install tensorflow
You can download other modules in the same way.

Now when you want to work with python 3.6 open. Python from the dock. And work.. and if you want to work on 3.7 you can open the python 3.7 and it will also work fluently

To install modules in python 3.7,. Just type: python3.7 -m pip install package namr

Got python3.7.2 very recent compiled for windows with CUDA 10, links at this repo:
https://github.com/PlatinumLyfe/tf-windows-gpu/

Hi, any progress on this compatibility issue?

bbhattmaclap:~ bbhatt$ pip3 install --upgrade tensorflow
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
bbhattmaclap:~ bbhatt$

@BhuvaneshBhatt the latest tensorflow official package does not have Python3.7 support. You'll have to use your tf-nightly-gpu package. We are trying to have it for 1.13.

@PlatinumLyfe unable to install.
your link only have xxx-cp36-cp36m-....
no cp37 and no -gpu- version.

Please stop asking for other people to provide compiled binaries. In addition to spamming everyone interested in when official Python 3.7 support lands, asking on a publicly commentable page for someone to send you a binary to run is not particularly secure.

Tensorflow 1.13-rc0 has been released (https://github.com/tensorflow/tensorflow/releases/tag/v1.13.0-rc0), however there is no Python 3.7 build on PyPI (https://pypi.org/project/tensorflow/1.13.0rc0/#files). Will Tensorflow 1.13 be released for Python 3.7 officially?

We are aiming to try and have Windows and Ubuntu python binaries by rc2 or the official.

Any news about Mac support? I'm stuck on Mac for now.
On Jan 24, 2019, 6:55 AM -0600, Amit Patankar notifications@github.com, wrote:

We are aiming to try and have Windows and Ubuntu python binaries by rc2 or the official.

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

We now have a tf-nightly CPU package for Mac. Will try and have that for rc2 as well.

To anyone else coming to this thread, the above mentioned tf-nightly packages are good. Install them with pip3 install tf-nightly for the CPU version. Tested, working on Python 3.7.2 on MacOS Mojave 10.14.2

The 1.13.0rc1 release includes Python3.7 binaries for all OS-es for cpu and gpu.

I can't seem to be able to install it. Any simple troubleshooting steps ?
EDIT : Issue was the 32-bit version of CPython was used on a 64-bit system.

@MagixInTheAir I'm closing this issue since it's just about general Python 3.7 support. Please reopen a new issue with logs and more information about your setup if you're still having issues.

Tensorflow 1.13.1 now supports Python 3.7.

https://pypi.org/project/tensorflow/#files There are cp37 releases for tensorflow==1.13.1. There may be something wrong in your environment.

I am using 3.7.2 and I have the same issue, the version/tags reported for 1.31.1 are the following:

{('cp37', 'cp37m', 'manylinux1_x86_64')}

while my 3.7.2 supports the following:

[('cp37', 'cp37m', 'linux_x86_64'), ('cp37', 'abi3', 'linux_x86_64'), ('cp37', 'none', 'linux_x86_64'), ('cp36', 'abi3', 'linux_x86_64'), ('cp35', 'abi3', 'linux_x86_64'), ('cp34', 'abi3', 'linux_x86_64'), ('cp33', 'abi3', 'linux_x86_64'), ('cp32', 'abi3', 'linux_x86_64'), ('py3', 'none', 'linux_x86_64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]

(from pep425tags.get_supported())

so I believe the issue is just that it should be linux not manylinux1 in the wheel name.

I have a clean python build from source with almost default parameters.

@dellelce you may be using a very old version of pip?

import pip._internal; print(pip._internal.pep425tags.get_supported())

gives me manylinux tags.

I just checked and the problem is with the alpine build, my build (dellelce/py-base) and official docker alpine image (python:alpine) have the issue while an image built on debian (python:latest) works fine.
It must be related to the libc library used (musl vs glibc) ? So other dists that do not used glibc may have the issue...

All have latest pip and 3.7.3 or 3.7.2...

I’m pretty sure that Alpine is not included in the many Linux that manylinux supports.

@ppwwyyxx should we have another ticket for supporting non-glibc linux distributions?

PEP 571/PEP 513 ("manylinux") support only glibc.

@dellelce Supporting alpine linux could be an interesting idea but may not be trivial. At the moment most of the tensorflow binaries are compiled with Ubuntu 14.04. Even some other commonly used platforms (e.g. CentOS) occasionally encountered some issues. I think alpine support is unlikely to be a priority in the short term.

Opening an issue is always a good thing, as it could help gauge the need and interest from the community, and it could always be labeled as "contributions welcome".

Was this page helpful?
0 / 5 - 0 ratings