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, 2019 in Python by ana1504.k
• 7,910 points
4,346 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, 2019 by SDeb
• 13,300 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
2,227 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,720 points
6,571 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
• 58,090 points
2,447 views
+1 vote
3 answers
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,023 views
0 votes
1 answer
0 votes
1 answer

No module named urllib3

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

answered Jan 24, 2019 in Python by SDeb
• 13,300 points
8,488 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
• 13,300 points
2,103 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP