Python Forum

Full Version: Python import tensorflow error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
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.
(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?
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).
(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?
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
(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)
Try with double _:

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