New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install TensorFlow on Python3.7 with pip #20444

Closed
natsukium opened this Issue Jun 30, 2018 · 86 comments

Comments

Projects
None yet
@natsukium
Copy link

natsukium commented Jun 30, 2018

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): N/A
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS 10.13
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): 1.8
  • Python version: 3.7
  • Bazel version (if compiling from source): N/A
  • GCC/Compiler version (if compiling from source): N/A
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A
  • Exact command to reproduce: pip install tensorflow

Describe the problem

Installing TensorFlow on Python3.7 with pip failed. Please see the failure log below.

Source code / logs

Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

@roosephu

This comment has been minimized.

Copy link

roosephu commented Jun 30, 2018

I installed it successfully by pip install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.8.0-py3-none-any.whl. However, it seems that this wheel is not Python 3.7 compatible. The problem is that tensorflow/python/pywrap_tensorflow_internal.py contains async as variable names but async becomes a keyword in python3.7 so it's no longer available.

Also, I noticed that the URL is only for Python 3.4, 3.5, 3.6 but I can't find any other URLs. So probably we need to wait for the official Python 3.7-compatible package.

@natsukium

This comment has been minimized.

Copy link
Author

natsukium commented Jul 1, 2018

Thank you for identifying the cause!

@iamtodor

This comment has been minimized.

Copy link

iamtodor commented Jul 23, 2018

still can't install it with python3.7

(env) mcbk:trainer todor$ pip3 install tensorflow
Collecting tensorflow
  Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
(env) mcbk:trainer todor$ which python3.7
/Users/todor/xor/projects/trainer/env/bin/python3.7
(env) mcbk:trainer todor$ which pip3
/Users/todor/xor/projects/trainer/env/bin/pip3
@dodiku

This comment has been minimized.

Copy link

dodiku commented Jul 25, 2018

same here.

@lihan

This comment has been minimized.

Copy link

lihan commented Aug 1, 2018

+1

@poxvoculi poxvoculi assigned martinwicke and unassigned poxvoculi Aug 1, 2018

@lolosssss

This comment has been minimized.

Copy link

lolosssss commented Aug 2, 2018

Any update?

@chrisbenson

This comment has been minimized.

Copy link

chrisbenson commented Aug 3, 2018

chriss-mbp:~ chris$ pip3 install tensorflow
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

Any update on a fix for this? Thank you.

@Olshansk

This comment has been minimized.

Copy link

Olshansk commented Aug 4, 2018

Why was this issue closed?

@jparsert

This comment has been minimized.

Copy link

jparsert commented Aug 6, 2018

Has the problem with this wheel https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.8.0-py3-none-any.whl been fixed? Or rather what is the new link/version?

@thyeun

This comment has been minimized.

Copy link

thyeun commented Aug 7, 2018

because of python 3.7 fully release, all production opencv are death because of tensorflow are incompatible. HELP pls!!!!!!

@kontarsoma

This comment has been minimized.

Copy link

kontarsoma commented Aug 8, 2018

Same issue here..would be awesome to know when a fix is going to be available for this issue :)

@richardARPANET

This comment has been minimized.

Copy link

richardARPANET commented Aug 8, 2018

This is preventing me from upgrading several projects to 3.7, fix ETA would be great.

@thyeun

This comment has been minimized.

Copy link

thyeun commented Aug 8, 2018

@richardARPANET issue is we won't know what will happen before upgrade python 3.7, because nobody will go and check each module either it is compatible or not.

And due to that, after upgrade to python 3.7, everything become nightmare.

@richardARPANET

This comment has been minimized.

Copy link

richardARPANET commented Aug 8, 2018

@thuyen isn't that why automated tests exist?

@edwardzjl

This comment has been minimized.

Copy link

edwardzjl commented Aug 11, 2018

same here.

@prabhu1990

This comment has been minimized.

Copy link

prabhu1990 commented Aug 14, 2018

Same issue here too.

@christiaanleysen

This comment has been minimized.

Copy link

christiaanleysen commented Aug 14, 2018

Same issue here. Such a shame because I want to use it in cloud functions of GCP, which only supports 3.7 ATM...

@bstriner

This comment has been minimized.

Copy link
Contributor

bstriner commented Aug 16, 2018

@christiaanleysen works fine on 3.7 with some minor tweaks and patches if you're willing to build yourself: #21202

@Mahamatnour

This comment has been minimized.

Copy link

Mahamatnour commented Aug 16, 2018

that's work for me
just try to use this one below
pip install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.8.0-py3-none-any.whl

@SukeshP1995

This comment has been minimized.

Copy link

SukeshP1995 commented Aug 17, 2018

How to build tendorflow-gpu with fix for python 3.7? @bstriner

@outan

This comment has been minimized.

Copy link

outan commented Nov 29, 2018

$ pip --version
pip 18.1 

$ python --version
Python 3.7.0

$ pip install tensorflow
Collecting tensorflow
  Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

$ pip search tensorflow
tensorflow (1.12.0)       - TensorFlow is an open source machine learning framework for everyone.

$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl

$ python
Python 3.7.0 (default, Oct 18 2018, 15:08:12)
[Clang 10.0.0 (clang-1000.10.44.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.7
  return f(*args, **kwds)
>>> tensorflow.__version__
'1.12.0'

@aaronke

This comment has been minimized.

Copy link

aaronke commented Dec 5, 2018

pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
not work for python 3.7.1

@Dhull442

This comment has been minimized.

Copy link

Dhull442 commented Dec 11, 2018

I found this to work after searching for a while. I will leave this here as it might be useful for someone.

Tensorflow only supports Python 3.6 as of today. You can install a different version of python alongside your standard one. You need to:

* Download the Python3.6 tgz file from the official website (eg. Python-3.6.6.tgz)

* Unpack it with `tar -xvzf Python-3.6.6.tgz`

* `cd Python-3.6.6`

* run `./configure`

* run `make altinstall` to install it (`install` vs `altinstall` explanation here https://stackoverflow.com/questions/16018463/difference-in-details-between-make-install-and-make-altinstall)

You'll normally find your new python install under /usr/local/bin. Now you can create a new virtualenv specifying the python version with:

* `virtualenv --python=python3.6 env3.6`

* Get into the virtualenv running the command `source env3.6/source/bin/activate`.

* Install tensorflow with the classic `pip install tensorflow`

* Profit

There's a typo in running the virtual env command. It should be source env3.6/bin/activate

@mytrjp

This comment has been minimized.

Copy link

mytrjp commented Dec 13, 2018

I had same issue. Try this:

  • Downgrade your python from 3.7 to 3.6 (if using conda virtual env, create a new virtual env with ' conda create -n yourenvname python==3.6 anaconda' )
  • Then 'pip install tensorflow-gpu'

should be worked..

@shahril96

This comment has been minimized.

Copy link

shahril96 commented Dec 16, 2018

If you're using x86_64 and any Linux distro, then you can find below GitHub repo to be useful.

https://github.com/evdcush/TensorFlow-wheels

I have tried and successfully installed into my machine.

$ wget https://github.com/evdcush/TensorFlow-wheels/releases/download/tf-1.12.0-py37-cpu-ivybridge/tensorflow-1.12.0-cp37-cp37m-linux_x86_64.whl
$ pip install --user tensorflow-1.12.0-cp37-cp37m-linux_x86_64.whl  
$ python
Python 3.7.1 (default, Oct 22 2018, 10:41:28) 
[GCC 8.2.1 20180831] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> print(tensorflow.__version__)
1.12.0
>>>

If you want Tensorflow + GPU build, then you can choose which one you want using above Github repo page.

Cheers.

@reemhamz

This comment has been minimized.

Copy link

reemhamz commented Dec 19, 2018

pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
that's which i use, python 3.7 on windows and it works.

Just want you to know that this worked fantastically. Thanks!

@jokandre

This comment has been minimized.

Copy link

jokandre commented Dec 20, 2018

Any suggestions for linux?

pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.12.0-cp36-cp36m-linux_x86_64.whl

tensorflow-1.12.0-cp36-cp36m-linux_x86_64.whl is not a supported wheel on this platform.

@nasser0110

This comment has been minimized.

Copy link

nasser0110 commented Dec 24, 2018

somebody could help me !
I've already installed python 3.7.1 wanna install tensor-flow but i can't
any one who could tell me how to fix this problem

@reemhamz

This comment has been minimized.

Copy link

reemhamz commented Dec 25, 2018

somebody could help me !
I've already installed python 3.7.1 wanna install tensor-flow but i can't
any one who could tell me how to fix this problem

Hi Nasser, unfortunately Tensorflow doesn't work with Python v3.7 yet. You'll have to uninstall, go into Python's website and install Python v3.6. The good thing is there are not many differences :) Just be sure to reinstall all your packages. I personally took a screenshot of all my packages (i.e. go into command prompt, and type in pip list, then take a screenshot) and referred to them to install everything again.

Cheers

@nasser0110

This comment has been minimized.

Copy link

nasser0110 commented Dec 25, 2018

somebody could help me !
I've already installed python 3.7.1 wanna install tensor-flow but i can't
any one who could tell me how to fix this problem

Hi Nasser, unfortunately Tensorflow doesn't work with Python v3.7 yet. You'll have to uninstall, go into Python's website and install Python v3.6. The good thing is there are not many differences :) Just be sure to reinstall all your packages. I personally took a screenshot of all my packages (i.e. go into command prompt, and type in pip list, then take a screenshot) and referred to them to install everything again.

Cheers

Thanks

@Drfate13

This comment has been minimized.

Copy link

Drfate13 commented Dec 25, 2018

when will tensorflow be supported for python 3.7.2?

@Pushkar-Singh-14

This comment has been minimized.

Copy link

Pushkar-Singh-14 commented Dec 27, 2018

@PiotrWegrzyn

This comment has been minimized.

Copy link

PiotrWegrzyn commented Dec 29, 2018

$ pip --version
pip 18.1 

$ python --version
Python 3.7.0

$ pip install tensorflow
Collecting tensorflow
  Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

$ pip search tensorflow
tensorflow (1.12.0)       - TensorFlow is an open source machine learning framework for everyone.

$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl

$ python
Python 3.7.0 (default, Oct 18 2018, 15:08:12)
[Clang 10.0.0 (clang-1000.10.44.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.7
  return f(*args, **kwds)
>>> tensorflow.__version__
'1.12.0'

Well this doesn't work for me. After the download with pip finished it says no module named tensorflow

@mcourteaux

This comment has been minimized.

Copy link

mcourteaux commented Dec 30, 2018

Okay guys... Spent two hours. Quick workaround for now: It's as simple as...... Use python3.6.5_1 for now. Launch your tensorflow-based applications with the full path to the older python executable.

❯ /usr/local/Cellar/python3/3.6.5_1/bin/python3
Python 3.6.5 (default, Jun 17 2018, 12:13:06)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
>>> tensorflow.__version__
'1.12.0'
>>>

Just make sure you manage to install this python version using homebrew or some other way. Now everything else can use regular up-to-date python 3.7, while we wait for TensorFlow devs to fix this.

@sahle123

This comment has been minimized.

Copy link

sahle123 commented Jan 1, 2019

@PiotrWegrzyn,

See if the following works for you:
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl

@jpribyl

This comment has been minimized.

Copy link

jpribyl commented Jan 3, 2019

@shahril96

Your solution worked for me on arch linux, thank you!

@QianShengWu

This comment has been minimized.

Copy link

QianShengWu commented Jan 5, 2019

even if you successful install tensorflow1.12 in python 3.7, it'll get some unexpected error like:
'tf.constant(5)' get 'UnboundLocalError: local variable 'self' referenced before assignment'

@PrimozGodec

This comment has been minimized.

Copy link

PrimozGodec commented Jan 11, 2019

When can we expect to have Tensorflow for Python 3.7 on PIP? When you include it in another package as a dependency other options do not work.

@martinwicke

This comment has been minimized.

Copy link
Member

martinwicke commented Jan 11, 2019

TensorFlow will have a 3.7 on pip when its dependencies have one. This, in particular, means protobuf. There are patches for protobuf making it possible to work on 3.7 (since November, roughly), but there hasn't been a release yet.

@ilovesusu

This comment has been minimized.

Copy link

ilovesusu commented Jan 14, 2019

It seems difficult to support python3.7. It's been months and still no progress

@ps360pa

This comment has been minimized.

Copy link

ps360pa commented Jan 21, 2019

+1

2 similar comments
@antoinecarme

This comment has been minimized.

Copy link

antoinecarme commented Jan 21, 2019

+1

@ANUBHAVNATANI

This comment has been minimized.

Copy link

ANUBHAVNATANI commented Jan 25, 2019

+1

@campanelli-resonon

This comment has been minimized.

Copy link

campanelli-resonon commented Jan 29, 2019

Python group insists on releasing breaking language changes with a minor version bump.

@aaa-manuelhe

This comment has been minimized.

Copy link

aaa-manuelhe commented Jan 31, 2019

I thought Python was done with these breaking changes. But come on Google async as a variable name?

@krassowski

This comment has been minimized.

Copy link

krassowski commented Jan 31, 2019

I just wanted to highlight that posting +1 or loosely connected remarks will spam mailboxes of about 65 people watching this thread (I bet many hope that the next notification will say that we got a release for Python 3.7).

To subscribe to notifications without writing a comment one can click "subscribe" button on the top-right of the page. I think that the numer of subsribers will be as good indication of interst in this problem to the maintatiners as writing "+1" but without notifying everyone else. Thank you :)

Also, here is another highlight: async was actually introduced in Python 3.5, released in September 2015 - which was more than three years ago. And they had warned:

async and await are not recommended to be used as variable, class, function or module names. Introduced by PEP 492 in Python 3.5, they will become proper keywords in Python 3.7.

@danmackinlay

This comment has been minimized.

Copy link

danmackinlay commented Feb 4, 2019

So I believe we can follow an actual open ticket for this at #25429

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment