Tensorflow installation error: not a supported wheel on this platform

后端 未结 13 952
别跟我提以往
别跟我提以往 2020-11-29 01:53

when I try to install tensorflow by cloning from git, I run into the error \"no module named copyreg,\" so I tried installing using a virtualenv. However, I then run into th

相关标签:
13条回答
  • 2020-11-29 02:27

    This may mean that you are installing the wrong pre-build binary

    since my CPU on Ubuntu 18.04 my download url was: https://github.com/lakshayg/tensorflow-build/releases/download/tf1.12.0-ubuntu18.04-py2-py3/tensorflow-1.12.0-cp36-cp36m-linux_x86_64.whl

    as it can be found on this github page: https://github.com/lakshayg/tensorflow-build

    pip install --ignore-installed --upgrade <LOCAL PATH / BINARY-URL>
    

    resolved the issue for me.

    0 讨论(0)
  • 2020-11-29 02:29

    It means that the version of your default python (python -V) and the version of your default pip (pip -V) do not match. You have built tensorflow with your default python and trying to use a different pip version to install it. In mac, delete /usr/local/bin/pip and rename(copy) pipx.y (whatever x.y version that matches your python version) to pip in that folder.

    0 讨论(0)
  • 2020-11-29 02:31

    I too got the same problem
    I downloaded get-pip.py from https://bootstrap.pypa.io/get-pip.py

    and then ran python2.7 get-pip.py for installing pip2.7

    and then ran the pip install command with python2.7 as follows

    For Ubuntu/Linux:

    python2.7 -m pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
    

    For Mac OS X:

    python2.7 -m pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
    

    this should work just fine as it did for me :)

    I followed these instructions from here

    0 讨论(0)
  • 2020-11-29 02:34

    On Windows 10, with Python 3.6.X version I was facing same then after checking deliberately , I noticed I had Python-32 bit installation on my 64 bit machine. Remember TensorFlow is only compatible with 64bit installation of python. Not 32 bit of Python

    If we download Python from python.org , the default installation would be 32 bit. So we have to download 64 bit installer manually to install Python 64 bit. And then add

    1. C:\Users\\AppData\Local\Programs\Python\Python36
    2. C:\Users\\AppData\Local\Programs\Python\Python36\Scripts

    Then run gpupdate /Force on command prompt. If python command doesnt work for 64 bit restart your machine.

    Then run python on command prompt. It should show 64 bit

    C:\Users\YOURNAME>python
    Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    

    Then run below command to install tensorflow CPU version(recommended)

    pip3 install --upgrade tensorflow
    
    0 讨论(0)
  • 2020-11-29 02:35

    After activating the virtualenv, be sure to upgrade pip to the latest version.

    (your_virtual_env)$  pip install --upgrade pip
    

    And now you'll be able to install tensor-flow correctly (for linux):

    (your_virtual_env)$  pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.0-py2-none-linux_x86_64.whl
    
    0 讨论(0)
  • 2020-11-29 02:37

    I was trying to install CPU TF on Ubuntu 18.04, and the best way (for me...) I found for it was using it on top of Conda, for that:

    1. To create Conda ‘tensorflow’ env. Follow https://linuxize.com/post/how-to-install-anaconda-on-ubuntu-18-04/
    2. After all installed see https://conda.io/projects/conda/en/latest/user-guide/getting-started.html And use it according to https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#managing-environments
    3. conda create --name tensorflow
    4. source activate tensorflow
    5. pip install --upgrade pip
    6. pip install tensorflow-cpu==1.15
    7. pip install --ignore-installed --upgrade tensorflow
    8. Test TF E.g. on 'Where' with:

    python

    import tensorflow as tf
    

    tf.where([[True, False], [False, True]])

    expected result:

    <tf.Tensor: shape=(2, 2), dtype=int64, numpy=
    array([[0, 0],
           [1, 1]])>
    
    • After Conda upgrade I got: DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.

    So you should use:

    ‘conda activate tensorflow’ / ‘conda deactivate’
    
    0 讨论(0)
提交回复
热议问题