Python Forum
Python import tensorflow error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python import tensorflow error
#1
I'm using Enthought Canopy which came with python 3.5. However when I tried to import tensorflow, it gave me this error message: "/Users/abiao0007/Library/Enthought/Canopy/edm/envs/User/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5".

Now, I know I need to update my python 3.5 to 3.6, but the question is how? Which method to proceed? Do I need to uninstall 3.5 first and then install 3.6, or can I just update 3.5 to 3.6 using certain command? Thanks!
Reply
#2
You can have both pythons but you'll have to set them correct in your Environment Variable "Path".
But a better choice will be installing the 3.5 version of TensorFlow using the 3.5 version of pip.
Reply
#3
(Jun-22-2018, 08:39 AM)gontajones Wrote: You can have both pythons but you'll have to set them correct in your Environment Variable "Path". But a better choice will be installing the 3.5 version of TensorFlow using the 3.5 version of pip.

Really? But I heard Tensorflow 1.3.0 which is "3.5 version of Tensorflow" is outdated and some of the features were no longer supported in 1.4.0, so is it better to get python 3.6.X instead?
Reply
#4
I personally recommend that:
- Install python 3.6 using the installer (exe).
- Install TensorFlow with pip (3.6, it is part of the python installer).
Reply
#5
(Jun-22-2018, 05:15 PM)gontajones Wrote: I personally recommend that: - Install python 3.6 using the installer (exe). - Install TensorFlow with pip (3.6, it is part of the python installer).

Im using MacOS, and I already installed Canopy 2.1.9, what's next?
Reply
#6
Maybe this tutorial can help you:
a-quick-guide-to-installing-tensorflow-on-mac-os

What are the outputs of these commands on your system?
python --version
pip --version
Reply
#7
(Jun-22-2018, 05:31 PM)gontajones Wrote: Maybe this tutorial can help you: a-quick-guide-to-installing-tensorflow-on-mac-os What are the outputs of these commands on your system?
 python --version pip --version 

This is what I did:
After I used the command "!pip install /Users/abiao0007/enthought/tensorflow-1.4.0-cp35-cp35m-macosx_10_11_x86_64.whl", I saw a new version of Tensorflow was downloading. Before I download this new Tensorflow, I would received an error after "import tensorflow as tf". Now when I want to check on the version of my new tensorflow, I got this new error message. Did I type it wrong or something?

This is the new error message:(https://drive.google.com/file/d/1FbNyw1GaIFAt1_JPxj4GiO-3b02uRHjG/view?usp=sharing)
Reply
#8
Try with double _:

print(tf.__version__)
My current version is the 1.8.0.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  trax import error dhrsethi1 0 476 Dec-08-2023, 11:13 AM
Last Post: dhrsethi1
  issue displaying summary of whole keras CNN model on TensorFlow with python Afrodizzyjack 0 1,621 Oct-27-2021, 04:07 PM
Last Post: Afrodizzyjack
  Error when import Keras Azadfalah 1 2,754 Apr-29-2020, 04:45 AM
Last Post: buran
  How to install tensorflow? It shows as error jaroslavtavgen 1 1,926 Apr-26-2020, 10:09 PM
Last Post: Larz60+
  TensorFlow CNN get error - DataType uint8 not in list vokoyo 3 6,385 Nov-09-2019, 04:03 AM
Last Post: xuanloc97
  TensorFlow get error - array with more than one element is ambiguous vokoyo 3 5,503 Nov-07-2019, 01:12 PM
Last Post: ThomasL
  Newbie at using python and tensorflow getting error when running simple code FeatherineAu 0 3,966 Sep-28-2018, 02:09 PM
Last Post: FeatherineAu
  Import Error for Templates arohanajit232 0 2,076 May-28-2018, 03:00 PM
Last Post: arohanajit232

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020