poetry: can't install tensorflow==2.0.0rc0 with poetry (python3.6.5)
- I am on the latest Poetry version.
- (I’m actually on 1.0.0b1)
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: MacOS 10.14.5
- Poetry version: 1.0.0b1
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/zachmoshe/36ec3cc128545aa8ab49a2d4dcd9cd52
Issue
- Open a new project (
poetry new .
) - run
poetry add tensorflow==2.0.0rc0
Fails because it can’t install functools32 (for python2 only). debug logs - https://gist.github.com/zachmoshe/8bd72026dd727380f4b88dc4ef55ff4f
Installing previous versions works and installing rc0
with pip also works.
I understand functools32
is a new dependency and that somehow we try to install a version which only work with python2. I just can’t understand why do we try this specific version.
Any solution or a workaround?
Thanks!
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 13
- Comments: 28 (3 by maintainers)
Commits related to this issue
- WIP: Attempt to use poetry for dependency management On hold due to https://github.com/sdispater/poetry/issues/1330 — committed to Notgnoshi/research by Notgnoshi 5 years ago
- WIP: Attempt to use poetry for dependency management On hold due to https://github.com/sdispater/poetry/issues/1330 — committed to Notgnoshi/research by Notgnoshi 5 years ago
- WIP: Attempt to use poetry for dependency management On hold due to https://github.com/sdispater/poetry/issues/1330 — committed to Notgnoshi/research by Notgnoshi 5 years ago
- Poetry doesn't play nicely with TF 2.0 so give up Give up on testing against TF 2.0 because Poetry can't install it well (see https://github.com/python-poetry/poetry/issues/1330) — committed to pshved/tensorbank by pshved 4 years ago
Uh, if pip installs it fine, but poetry screws up, is it really “rightly”?
Unfortunately, this is not on Poetry’s end. If you take a look at https://pypi.org/pypi/tensorflow/json in the
requires_dist
section of theinfo
property,functools32
is specified as a dependency without any environment marker so Poetry rightly assumes that it’s an unconditional dependency.So, this issue must be fixed upstream by the tensorflow maintainers
works for me
tensorflow
2.1.0
should be released soon.Is there a particular workaround at the moment so that TF 2.0 can be installed?
Installing Tensorflow 1.15.2 or 1.15.3 works fine for me.
For anyone having similar issues, I’d recommend trying
poetry shell
thenpip install -U pip
to upgrade pip. I was having issues with poetry findingtensorflow@2.1.0
, and found that the poetry virtualenv pip was on version 17, even though mine was on 20.https://github.com/tensorflow/tensorflow/pull/32758 It may fixes the issue, but need to wait until 2.1 release.
I also ran into this issue with Tensorflow 1.15.0, but Tensorflow 1.14.0 installs OK.
This is also a problem with Tensorflow 1.15, and some python libraries require the 1.x version of Tensorflow.
This exact problem is related to a Tensorflow release candidate having bad metadata. If you’re having issues installing Tensorflow, I suggest you go to Discussions or Discord to get help, as there are many common misconceptions and pitfalls, and we don’t yet have a FAQ for involved binary packages like Tensorflow and PyTorch.
I found some reasons that functools32 dependency found even if Python3 projects you have:
https://pypi.org/ pypi/tensorflow/2.0.0rc0/json
:ref: https://github.com/sdispater/poetry/blob/cb8dc0d94e68042f120441b4e30d89c92598b40e/poetry/repositories/pypi_repository.py#L286
So at first, we need to modify tensorflow package metadata. I think it’s a tensorflow team matter.
requires_dist
is null, poetry tries to get dependencies from universal bdist_wheel. and tensorflow doesn’t have a universal wheel, it chooses a first wheel to inspect (it’s a cp27 wheel).ref: https://github.com/sdispater/poetry/blob/cb8dc0d94e68042f120441b4e30d89c92598b40e/poetry/repositories/pypi_repository.py#L350
So poetry need to be fixed these logics, IMO, it should respect Python version of venv.