No module named __future__

0 votes
I am getting the following error: No module named __future__. I use tensorflow and it has Python2.7. Once I run a program, I got error as shown below:

import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/coie/tensorflow/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 19, in <module>
    from __future__ import absolute_import
ImportError: No module named __future__
 

How to install future into tensorflow's Python?
Mar 7 in Python by ana1504.k
• 6,630 points
26 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
In your /PATH/Python-2.7.x/Lib should be all your modules, incl. future

If you don't have the above, re-install Python.

If you do, run ls -l which will show you the permissions associated with the modules in the first column. *.py should read -rwxr-xr-x. If it reads -rw-r--r-- instead, the modules can't be imported or executed when they are called in your script. To fix this, change permissions with sudo chmod +x *.py.

Also, you need to check that python knows where to look for these modules. You can check this with echo $PYTHONPATH which should show you the path to you Lib directory. If not, set via export PYTHONPATH=$PYTHONPATH:/PATH/Python-2.7.13/Lib.
answered Mar 7 by SDeb
• 10,700 points

Related Questions In Python

0 votes
1 answer

ImportError: No module named requests

Requests is not available for use by ...READ MORE

answered Jun 26, 2018 in Python by Hamartia's Mask
• 1,580 points
524 views
+3 votes
1 answer

Tensorflow 1.5 ImportError: No module named tensorflow.python.client

I think it's a bug in Tensorflow ...READ MORE

answered Sep 25, 2018 in Python by charlie_brown
• 7,710 points
1,610 views
0 votes
1 answer

tensorflow 1.5 ImportError: No module named tensorflow.python.client

Some of the modules have changed in ...READ MORE

answered Oct 5, 2018 in Python by Priyaj
• 56,140 points
290 views
0 votes
1 answer

tensorflow 1.5 ImportError: No module named tensorflow.python.client

Some of the modules have changed in ...READ MORE

answered Oct 9, 2018 in Python by Priyaj
• 56,140 points
83 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
54 views
0 votes
1 answer

No module named urllib3

It is possible that either urllib3 is ...READ MORE

answered Jan 24 in Python by SDeb
• 10,700 points
605 views
0 votes
1 answer

Difference between module and Package in Python

A module is basically a single file ...READ MORE

answered Nov 13, 2018 in Python by SDeb
• 10,700 points
77 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.