tensorflow: typing-extensions package is conflicted
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
macOS 11.5.2 - Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: -
- TensorFlow installed from (source or binary): binary
- TensorFlow version:
2.6.0 - Python version:
3.8.10 - Installed using virtualenv? pip? conda?:
virtualenvandpip - Bazel version (if compiling from source): -
- GCC/Compiler version (if compiling from source): -
- CUDA/cuDNN version: -
- GPU model and memory: -
Describe the problem
I installed tensorflow using pip on the virtualenv. The typing-extensions package is conflicted with black package dependency. black==21.8b0 is required typing-extensions>=3.10.0.0. But, tensorflow has 'typing_extensions ~= 3.7.4 dependency. Are there any plans to upgrade the typing-extensions dependency package version?
Provide the exact sequence of commands / steps that you executed before running into the problem
$ python3 -m venv venv
$ . venv/bin/activate
$ pip install -U pip
$ pip install black
$ pip install tensorflow
Any other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
$ pip install tensorflow
Requirement already satisfied: tensorflow in ./venv/lib/python3.8/site-packages (2.6.0)
Requirement already satisfied: keras-preprocessing~=1.1.2 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.1.2)
Requirement already satisfied: astunparse~=1.6.3 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.6.3)
Requirement already satisfied: opt-einsum~=3.3.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (3.3.0)
Collecting typing-extensions~=3.7.4
Using cached typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Requirement already satisfied: numpy~=1.19.2 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.19.5)
Requirement already satisfied: wrapt~=1.12.1 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.12.1)
Requirement already satisfied: tensorflow-estimator~=2.6 in ./venv/lib/python3.8/site-packages (from tensorflow) (2.6.0)
Requirement already satisfied: six~=1.15.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.15.0)
Requirement already satisfied: wheel~=0.35 in ./venv/lib/python3.8/site-packages (from tensorflow) (0.37.0)
Requirement already satisfied: google-pasta~=0.2 in ./venv/lib/python3.8/site-packages (from tensorflow) (0.2.0)
Requirement already satisfied: flatbuffers~=1.12.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.12)
Requirement already satisfied: tensorboard~=2.6 in ./venv/lib/python3.8/site-packages (from tensorflow) (2.6.0)
Requirement already satisfied: keras~=2.6 in ./venv/lib/python3.8/site-packages (from tensorflow) (2.6.0)
Requirement already satisfied: protobuf>=3.9.2 in ./venv/lib/python3.8/site-packages (from tensorflow) (3.17.3)
Requirement already satisfied: gast==0.4.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (0.4.0)
Requirement already satisfied: termcolor~=1.1.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: grpcio<2.0,>=1.37.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (1.39.0)
Requirement already satisfied: clang~=5.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (5.0)
Requirement already satisfied: absl-py~=0.10 in ./venv/lib/python3.8/site-packages (from tensorflow) (0.13.0)
Requirement already satisfied: h5py~=3.1.0 in ./venv/lib/python3.8/site-packages (from tensorflow) (3.1.0)
Requirement already satisfied: markdown>=2.6.8 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (3.3.4)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (1.8.0)
Requirement already satisfied: werkzeug>=0.11.15 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (1.0.1)
Requirement already satisfied: google-auth<2,>=1.6.3 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (1.35.0)
Requirement already satisfied: tensorboard-data-server<0.7.0,>=0.6.0 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (0.6.1)
Requirement already satisfied: setuptools>=41.0.0 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (56.0.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (0.4.5)
Requirement already satisfied: requests<3,>=2.21.0 in ./venv/lib/python3.8/site-packages (from tensorboard~=2.6->tensorflow) (2.26.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in ./venv/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow) (4.2.2)
Requirement already satisfied: pyasn1-modules>=0.2.1 in ./venv/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow) (0.2.8)
Requirement already satisfied: rsa<5,>=3.1.4 in ./venv/lib/python3.8/site-packages (from google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow) (4.7.2)
Requirement already satisfied: requests-oauthlib>=0.7.0 in ./venv/lib/python3.8/site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.6->tensorflow) (1.3.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in ./venv/lib/python3.8/site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard~=2.6->tensorflow) (0.4.8)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./venv/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (1.26.5)
Requirement already satisfied: idna<4,>=2.5 in ./venv/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (3.2)
Requirement already satisfied: certifi>=2017.4.17 in ./venv/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (2021.5.30)
Requirement already satisfied: charset-normalizer~=2.0.0 in ./venv/lib/python3.8/site-packages (from requests<3,>=2.21.0->tensorboard~=2.6->tensorflow) (2.0.4)
Requirement already satisfied: oauthlib>=3.0.0 in ./venv/lib/python3.8/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard~=2.6->tensorflow) (3.1.1)
Installing collected packages: typing-extensions
Attempting uninstall: typing-extensions
Found existing installation: typing-extensions 3.10.0.1
Uninstalling typing-extensions-3.10.0.1:
Successfully uninstalled typing-extensions-3.10.0.1
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.
black 21.8b0 requires typing-extensions>=3.10.0.0, but you have typing-extensions 3.7.4.3 which is incompatible.
Successfully installed typing-extensions-3.7.4.3
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 21
- Comments: 22 (1 by maintainers)
The commit has been cherry-picked, so the next release candidate should fully resolve this
We need a cherry-pick of 41e6614 into
r2.7branch. We didnβt do it while working on the RC0 release, but I think we should get it for the next RC.This seems to be fixed on master by https://github.com/tensorflow/tensorflow/commit/41e66148999080da5b2b80a59740a8f2a59f17da. The
install_requiresis nowtyping_extensions >= 3.6.6.Awesome. Will review and approve and merge a while later when we do patch releases.
This issue makes
pipunable to installtensorflow==2.6.0alongsideastroid==2.8.0, compare https://github.com/PyCQA/astroid/commit/40ea1a3b8e52bbfed43deb1725cde461f4bd8a96#diff-fa602a8a75dc9dcc92261bac5f533c2a85e34fcceaff63b3a3a81d9acde2fc52, orblack==21.8b0, see https://github.com/psf/black/issues/2465.@mihaimaruseac @woodyza Since thereβs consideration of including this change in a 2.6 release, I went ahead and rebased my changes on the
r2.6branch and opened a new PR here: https://github.com/tensorflow/tensorflow/pull/53250I would have just reopened the old PR, but I had deleted the fork, so that wasnβt possible π¬
If thereβs a preference to more exactly match the changes cherry-picked into 2.7, I can change the version constraint to
typing-extensions >= 3.6.6πRC1 of TF 2.7 should already have this.
This isnβt too surprising to me as I would imagine that freezing the list of things that go into a release would happen several days if not week+ in advance. Releases are hard, especially for projects of this size.
This is good to know in advance though, so thank you for noting that!
For anyone wondering, this did not make it into
tensorflow==2.7.0rc0. https://github.com/tensorflow/tensorflow/blob/v2.7.0-rc0/tensorflow/tools/pip_package/setup.py#L94If just the two are specified then
pipis able to figure out the dependency mismatch and find a version ofblack(v21.7.b0) that will workFull Example in a python:3.9 Docker image:
but that
tensorflowis pinning down to the patch release here (typing-extensions~=3.7.4) is pretty restrictive (and making it so that everyone using TensorFlow needs to treat it like an application and not a library. c.f. PR #40789 for another example of problems coming from being overly restrictive, though this is just a historical note as the SciPy dependency has been removed and so no longer affects TensorFlow).In more complicated environments though I can get
pipto fail on this problem.Edit: Following @alexander-held example below I can get things to install on Python 3.9 but not on Python 3.8. c.f. example in details for
pip install black tensorflow tensorflow-probabilityon Python 3.9Example with TensorFlow Probability in a python:3.9 Docker image: