installing tensorflow_transform and apache_beam on Datalab - tensorflow

I'm going over these example from google-cloud Coursera courses, and although they worked till a few weeks ago, I can't install tf.transform or apache_beam on Datalab anymore.
https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/courses/machine_learning/feateng/tftransform.ipynb
https://github.com/GoogleCloudPlatform/training-data-analyst/blob/master/courses/machine_learning/deepdive/06_structured/4_preproc_tft.ipynb
When installing tensorflow_transform I get the following errors:
%bash
pip install --upgrade --force tensorflow_transform==0.6.0
twisted 18.7.0 requires PyHamcrest>=1.9.0, which is not installed.
datalab 1.1.3 has requirement six==1.10.0, but you'll have six 1.11.0 which is incompatible.
gapic-google-cloud-pubsub-v1 0.15.4 has requirement oauth2client<4.0dev,>=2.0.0, but you'll have oauth2client 4.1.2 which is incompatible.
proto-google-cloud-pubsub-v1 0.15.4 has requirement oauth2client<4.0dev,>=2.0.0, but you'll have oauth2client 4.1.2 which is incompatible.
apache-airflow 1.9.0 has requirement bleach==2.1.2, but you'll have bleach 1.5.0 which is incompatible.
apache-airflow 1.9.0 has requirement funcsigs==1.0.0, but you'll have funcsigs 1.0.2 which is incompatible.
google-cloud-monitoring 0.28.0 has requirement google-cloud-core<0.29dev,>=0.28.0, but you'll have google-cloud-core 0.25.0 which is incompatible.
proto-google-cloud-datastore-v1 0.90.4 has requirement oauth2client<4.0dev,>=2.0.0, but you'll have oauth2client 4.1.2 which is incompatible.
pandas-gbq 0.3.0 has requirement google-cloud-bigquery>=0.28.0, but you'll have google-cloud-bigquery 0.25.0 which is incompatible.
googledatastore 7.0.1 has requirement httplib2<0.10,>=0.9.1, but you'll have httplib2 0.11.3 which is incompatible.
googledatastore 7.0.1 has requirement oauth2client<4.0.0,>=2.0.1, but you'll have oauth2client 4.1.2 which is incompatible.
Cannot uninstall 'dill'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

The tensorflow version on my Datalab instance was 1.4.
I had to add this one line of code to update tensorflow to 1.10.1
%bash
pip install --upgrade --force-reinstall pip==10.0.1
pip install tensorflow==1.10.1
pip install tensorflow_transform
my environment:
apache-airflow==1.9.0
apache-beam==2.6.0
tensorflow==1.10.1
tensorflow-metadata==0.9.0
tensorflow-tensorboard==0.4.0rc3
tensorflow-transform==0.8.0

The current version of Datalab uses TensorFlow 1.8, so please change the notebook cell in question to:
%bash
pip uninstall -y google-cloud-dataflow
pip install --upgrade --force tensorflow_transform==0.8.0 apache-beam[gcp]
I've updated and checked in the two notebooks linked above.
Another problem might be that you are using Python 2. Datalab by default now uses Python 3 and your pip install (above) happens in Python 3 even if the kernel is Python 2 because %%bash opens up a new shell in which the conda activate of Python 2 has not happened.
To make sure the pip install happens in Python 2, change your pip install of apache-beam[gcp] as follows:
%%bash
source activate py2env
conda install -y dill pytz # do this for all the distutils complaints
pip uninstall -y google-cloud-dataflow
pip install --upgrade --force tensorflow_transform==0.8.0 apache-beam[gcp]

Related

issue in install tensorflow

when I use pip install tensorflow command that error appear :-
'''
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tf-nightly 2.6.0.dev20210601 requires gast==0.4.0, but you have gast 0.3.3 which is incompatible.
tf-nightly 2.6.0.dev20210601 requires h5py~=3.1.0, but you have h5py 2.10.0 which is incompatible.
tf-nightly 2.6.0.dev20210601 requires numpy~=1.19.2, but you have numpy 1.18.5 which is incompatible.'''
Looks like you are trying to install Tensorflow and tf-nightly on the same environment. Since Tensorflow and tf-nightly uses same code, you should never install both in same environment. Latest version overrides the most of the packages, thats how pip works. It recommended to use virtual environment each tensorflow version.
Tf-nightly require gast==0.4.0 and numpy==1.19.2.
Follow the below steps
python -m tf_nightly --system-site-packages .\venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install tf-nightly

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)

How to install tensorflow==2.3.0

I would like to test some function in the new tensorflow2.3 However, I am struggling with installation process.
I saw: How do I install the most recent Tensorflow (here: 2.2) on Windows when conda does not yet support it?
I executed: pip install --upgrade pip
I got:
ERROR: Could not find a version that satisfies the requirement tensorflow-cpu==2.3.0rc2 (from versions: 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0)
ERROR: No matching distribution found for tensorflow-cpu==2.3.0rc2
please make sure pip is pointing to pip3 because tensorflow requires python3
pip --version
pip3 install --upgrade tensorflow
I just ran into the same issue, but had to downgrade python from 3.9 to 3.8.
Python 3.8 is the latest version that supports tensorflow 2.3.0
For some cases, you need to upgrade your pip version
pip install --upgrade pip
then install tensorflow 2.3.0 version

how to resolve bleach==1.5.0 html5lib=0.9999999 on windows10

Hello I want to pip install pymc3 in tensorflow version 3.5 on windows
but it is not worked.
pip install git+https://github.com/pymc-devs/pymc3
tensorflow-tensorboard 1.5.0 has requirement bleach==1.5.0, but you'll have bleach 2.1.2 which is incompatible.
tensorflow-tensorboard 1.5.0 has requirement html5lib==0.9999999, but you'll have html5lib 1.0.1 which is incompatible
please help me :(
It is clear from the error that there is a mismatch of the package versions. You have several options from here.
If you haven't installed tensorboard already, install tensorboard and see if the error is resolved: pip install tensorboard
If you have installed tensorboard already, uninstall tensorboard with: pip uninstall tensorboard and specify the version of tensorboard you want to install: pip install tensorboard=1.5.1. Refer to here for more details
As suggested by your screenshot, it is evident that the package tensorflow-tensorboard is not compatible with the latest version of bleach package. These are interdependent packages.
An easy solution, as suggested by your command prompt is to use an older version of bleach package.
I tested the following command, which worked for me for installing bleach 1.5.0.pip install -I bleach==1.5.0
I am using pip version = 10.0.1.To check your current pip version, run the following command: pip --version
After you're done with the installation, you can check the version of all your installed packages usingpip freeze
For more information about this compatibility issue, refer this TensorFlow Article on GitHub.
You can do the same for html5lib as well, by following the exact steps above and changing the parameter.
Hope it works!
Tensorflow-tensorboard is not compatible with the latest version of bleach package.
You have to install the following packages by
$ pip install numpy==1.13.0 --user
You install the other with same
Check the version of pip:
$ pip --version
Update pip: $pip install --upgrade pip

Tensorflow on Ubuntu 16.04 Not Installing

I'm trying to install the GPU version of Tensorflow using Virtualenv on Ubuntu 16.04 and Python 3.6 (Anaconda), but it keeps on outputting these errors
tensorflow-gpu 1.7.0 requires numpy>=1.13.3, which is not installed.
tensorflow-gpu 1.7.0 requires six>=1.10.0, which is not installed.
tensorboard 1.7.0 requires numpy>=1.12.0, which is not installed.
tensorboard 1.7.0 requires six>=1.10.0, which is not installed.
tensorboard 1.7.0 requires werkzeug>=0.11.10, which is not installed.
protobuf 3.5.2.post1 requires six>=1.9, which is not installed.
html5lib 0.9999999 requires six, which is not installed.
grpcio 1.10.0 requires six>=1.5.2, which is not installed.
bleach 1.5.0 requires six, which is not installed.
absl-py 0.1.13 requires six, which is not installed.
I've tried installing both numpy and six using sudo pip install numpy six both in the virtualenv and out of it, but the error is still present. Any ideas on how to fix this?
You are using the conda and virtualenv simultaneously which is usually a bad idea. If you installed Python from anaconda use their environment tool.
conda create -n tensorflow pip python=3.6
source activate tensorflow
pip install --ignore-installed --upgrade\
https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.6.0-cp36-cp36m-linux_x86_64.whl
Additionally, have a look at how to install tensorflow with anaconda.