There is no module named __future__

I have a mistake like No module named __future__. I am using shadoworflow and have Python2.7. After starting the program, I received an 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 set the future in a tensor Python flow?

+4
source share
1 answer

Verify that your Python modules are executable.

Your /PATH/Python-2.7.x/Libshould have all of your modules, including. future

If you do not have the above, reinstall Python.

, ls -l, , . *.py -rwxr-xr-x. -rw-r--r-- , , script. , sudo chmod +x *.py.

, , python , . echo $PYTHONPATH, Lib. , export PYTHONPATH=$PYTHONPATH:/PATH/Python-2.7.13/Lib. : https://askubuntu.com/questions/250929/pythonpath-environment-variable

+2

Source: https://habr.com/ru/post/1660140/


All Articles