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
• 7,470 points
36 views

1 answer to this question.

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
• 12,360 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
569 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,958 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,160 points
384 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,160 points
101 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 133 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
• 12,360 points
801 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
• 12,360 points
93 views