Can not make Tensorflow work with pypy3 and conda. Invalid ELF - tensorflow

I want to try tensorflow inside pypy. I tried a few days and no luck. Following is the detail.
I am using UBuntu 18.04.
I install conda.
I install pypy through conda, conda install -c conda-forge pypy3.6
I got No matching distribution found for tensorflow if I tried pypy3 -m pip install tensorflow
I got invalid ELF header when I run my python code if I tried pypy3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl
I even try to install tensorflow I build but I got not a supported wheel on this platform. The Tensorflow I build can be installed in python3.6 just not in pypy3.
I think the problem is python version different but I don't know hwo to fix it. I notice the python version is slightly different between my python and pypy3.
I don't know how to make those two python 3.6.9 identical. Build pypy from source myself?
(pypy3) joseph#joseph-Ubuntu:~/scripts$ python
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)
[GCC 7.3.0] on linux
(pypy3) joseph#joseph-Ubuntu:~/scripts$ pypy3
Python 3.6.9 (5da45ced70e515f94686be0df47c59abd1348ebc, Oct 18 2019, 07:48:38)
[PyPy 7.2.0 with GCC 7.3.0] on linux
Or is there is other way to solve this problem?
Or Not to use conda?
Thanks
Joseph

You have to somehow get tensorflow compiled for PyPy, you cannot reuse one for CPython. So far there is no binary available, and I would not advise anyone to try to recompile tensorflow, it is quite hard. So I think for now sticking with CPython for tensorflow is the best course of action.

Related

tensorflow-data-validation cannot be pip installed

Since I'm moving away from pandas DataFrames to TensorFlow datasets, I'd like to use tensorflow-data-validation instead of the more traditional pandas-profiling when it comes to data exploration and validation.
However, pip install tensorflow-data-validation gives the following error:
ERROR: Could not find a version that satisfies the requirement tensorflow-data-validation (from versions: none)
ERROR: No matching distribution found for tensorflow-data-validation
What could be the problem? This old GitHub issue explains how this could be due to the Python version, but Apache Beam (on which tensorflow-data-validation presumably relies) is now fully compatible with Python 3, so it must be something else.
My environment is as follows:
Python 3.9.2
TensorFlow 2.6.0
Debian GNU/Linux 11 (bullseye)
pip 21.3
I got the same error when using Python 3.9. After downgrading to Python 3.8, pip install tensorflow-data-validation ran successfully.
Regarding your comment about Apache Beam, it looks like the Python SDK currently supports Python 3.8 (and earlier) but not yet Python 3.9.
My environment:
Python 3.8.10
TensorFlow 2.8.0
macOS Monterey (12.0.1)
pip 21.1.1
Try this
pip install --upgrade --force-reinstall tensorflow-data-validation[all]
It might be a version compatibility issue with tensorflow==2.6.0.
Try
pip install tensorflow-data-validation==1.3.0
I was able to install the tensorflow_data_validation library successfully, via the below command in my Google Colab file.
!pip install -U tensorflow \
tensorflow-data-validation \
apache-beam[gcp]

Installing tensorflow with pip results in errors

I'm trying to install TensorFlow with pip, but it shows me the following output:
pip install tensorflow
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement tensorflow
ERROR: No matching distribution found for tensorflow
I'm using Python 3.9.1 on Arch Linux.
Python 3.9 is not supported as far as I can tell: https://www.tensorflow.org/install/pip#system-requirements
You would need to use a supported version of the Python interpreter. The current supported interpreters seem to be: Python 3.5–3.8

Unable to install tensor flow with pip?

I just updated the latest MacOS and it wiped everything out.
I follow the steps from this website.
And I start reinstalling the tensorflow with pip3 and it's not installing anything.
I got this error from typing pip3 install --user --upgrade tensorflow .
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
FYI, my MacBook is 64-bit.
and
~ pip3 -V
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.2.4 from /Users/zack/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
~ python3 -V
Python 3.8.2
I don't know what happened does anyone have any ideas.
According to this documentation https://www.tensorflow.org/install/pip#package-location
and your version of python you should run
python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.3.0-cp38-cp38-macosx_10_14_x86_64.whl
This is the 3rd step, so check if you got installed correctly the packages from steps 1 and 2
if pip is not up-to-date upgrade pip:
pip install --upgrade pip
then install tensorflow:
pip install tensorflow
for python 3.8 you need to install tensorflow 2.2 or later
system requirements of tensorflow:
Python 3.5–3.8
Python 3.8 support requires TensorFlow 2.2 or later.
pip 19.0 or later (requires manylinux2010 support)
Ubuntu 16.04 or later (64-bit)
macOS 10.12.6 (Sierra) or later (64-bit) (no GPU support)

Python 3.8.3 incompatible with tensorflow

I recently installed python with the version 3.8.3 and upgraded pip to 20.1.1. According to enter link description here, conda install -c conda-forge tensorflow should work. However, I get this result
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- tensorflow -> python[version='3.5.*|3.6.*|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|3.7.*']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
since I use
(base) C:\Users\ivan>python --version
Python 3.8.3
(base) C:\Users\ivan>pip --version
pip 20.1.1 from C:\Users\ivan\anaconda3\lib\site-packages\pip (python 3.8)
I wonder if it is possible to solve this issue without downgrading. For users of anaconda 2020.07, python 3.8 is used by default. Downgrading it will break anaconda.
People have reported problems using tensorflow with python 3.8, it is best to use 3.7. You are incorrect about breaking Anaconda. Here is what to do.
In Anaconda home page click on environments. At the bottom left of the page click on create. A window will appear. Give the new environment a name (say python3.7). In the drop down menu select 3.7. Now a new environment is created using python 3.7. Now in the conda terminal type conda activate python3.7. Then use conda to install tensorflow. It will install version 2.1.1, the cuda toolkit version 10.1.243 and cudnn version 7.6.5. Note conda can only install tensorflow up to version 2.1.1. If you want tensorflow 2.2 install it with pip using pip install tensorflow ==2.2.0. after you have installed 2.1. The cuda toolkit and cudnn work with version 2.2. Now use pip or conda to install any other packages you need in your python3.7 environment and you should be good to go!

No matching distribution found for tensorflow

I am getting the error below when trying to install tensorflow for python in pip3 on Windows 10 Home. I will try installing via Anaconda next but does anyone know if tensorflow will work with python 3.6.4? (My system is pretty old.)
Error:
"Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow"
The command I am using is:
pip3 install --upgrade tensorflow
Currently I have python version 3.6.4
Other Info:
Windows 10 Home
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]
Processor: AMT Phenom(tm) Quad-Core Processor 2.4GHz
Upgrading from python 32 bits to Python 3.4, 3.5 or 3.6 (64 bits) worked for me.
How to check if your installed Python is 64 bits:
https://stackoverflow.com/a/41084963/3212785
I had the same issue, later figured out it has to do something with pip3 version.
Try running:
To upgrade pip3 version
pip3 install --upgrade pip
Then try:
pip3 install tensorflow==2.2
It's upon you which version of tensorflow you want to install
For those passing by and having the same error you may need to:
downgrade/upgrade python version so that it fits in the supported interval - from what I've read tensorflow usually supports the latest version available on ubuntu and a bit before which is right now one version lower (3.5-3.8 instead of 3.9)
upgrade python to a 64bit version
Hope this helped, downgrading worked for me
Source: https://www.tensorflow.org/install