-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install TTS failure: pip._vendor.resolvelib.resolvers.ResolutionTooDeep: 200000 #12305
Comments
Can you try doing I expect that this is resulting in either (a) a really big dependency graph or (b) a really pathological case where the resolver is trying really hard to find something that works (but won't, due to bad dependency compatibility with the platform). The log file would help diagnose what exactly pip is doing here. |
Also, please attempt that with the latest pip release. |
Thanks @pradyunsg I'm doing that now, but it takes hours. |
No, that's abnormal -- but given the error you're reporting, that's not surprising. |
The first thing to do when faced with a problem like this is to install a specific version of the library you want. Currently the latest version is 0.17.6, if I try and install it using Python 3.8 on Windows I get:
This is because the latest version of TTS only supports Python 3.9 and Python 3.10. In general if you wanting to install the newest version of any project you should look at the minimum version that numpy supports: https://endoflife.date/numpy. Which is currently Python 3.9 Switching to Python 3.9 the install command runs fine for me:
So why does pip get stuck installing an older version of TTS on Python 3.8? Well I added some additional debugging statements and it appears to get stuck finding packages that agree on the correct version of numpy, here is one of the conflict steps:
The problem here is that TTS 0.14.3 is pinning to one version of numpy (1.21.6) that's relatively old (numpy 1.21.6 was released over 1 year before TTS 0.14.3) but many of it's other requirements are not as specific and many of them have some requirement on numpy. This creates a situation where Pip is not narrowinging down on what packages to backtrack and that causes an exponentials explosion in possibilities. I think there is a possible optimization that Pip, or possibly resolvelib, could implement here. Many of these requirements aren't really causes of backtracking, if we look at only requirements which contradict the most root requirement (numpy==1.21.6) we would narrow down to:
If Pip had prefered to backtrack on |
OK thanks @pradyunsg Thanks @notatallshaw for all the explanations. Should I give up or do you think I could try to install an older version of TTS? |
One trick to install an older version of packages is to use So in one windows create a new virtual environment and install pypi-timemachine, e.g.:
Then in another Window with the Python environment you want to install TTS into activated:
So you don't have to keep running timemachine again you can extract the version of everything installed and use them as a constraints file:
And now you can run this any time you need to reinstall
Here's the output of pip freeze you can use directly from me if you's prefer constraints-tts.txt
Finally there has been some recent talk of adding this time machine feature directly to Pip, I don't know how likely it is but this is defineltly a good example of where it would be useful. |
Thanks so much @notatallshaw |
FYI for anyone wanting to reproduce, this command is a slightly reduced version that doesn't involve compiling sdists and reproduces "pip._vendor.resolvelib.resolvers.ResolutionTooDeep: 200000" on Python 3.8 for both Windows and Linux:
|
I have the same problem, when |
I've already explained the details of why it gets stuck on 3.8 but not 3.9 here: #12305 (comment) The bug isn't with Python 3.8 directly, but rather the dependency graph that must be solved for 3.8 is much more complicated and Pip does not sufficually optimize it's backtracking. I have a working solution but it requires updating both the resolution library Pip uses, resolvelib, and Pip itself and I have not had time to make the proper PRs. |
Small update, I've created the initial PR for resolvelib sarugaku/resolvelib#145 (although it appears I need to do some work with tests). I've created an experimental Pip branch that implements prefering conflict causes here: https://github.com/notatallshaw/pip/tree/prefer-conflicting-causes Feel free to test it and provide any feedback, it seems to be able to resolve all requirements listed here. |
In my experience it is a path-dependent bug, not easy to reproduce. For instance I had the
|
@mirekphd have you tried installing from my branch: https://github.com/notatallshaw/pip/tree/prefer-conflicting-causes It solves every ResolutionTooDeep error I have seen so far. I will be pushing to merge the changes with Pip, but it is a multi step process. |
Just tried this, problem solved. |
@lwabish great to hear, do you have a reproducible example? |
@notatallshaw You can follow this to reproduce the problem. |
Unfortunately I wasn't able to reproduce, but I'm glad the branch helped you out. Hopefully I can get it into Pip in the future. |
That works for me , thanks |
Good to hear, I am working on a PR (#12499) but there are a lot of steps to get it into a pip and I have been working on other things recently. Do you have a public example that caused this error for you? |
Sure, I'm playing with this project, I followed the installation guide to install the dependencies but when executing to install
|
Method 1: Using the --max-rounds flag
Method 2: Setting the PIP_MAX_ROUNDS environment variable
Method 3: Editing the pip configuration file
|
@rolkey for me --max-rounds is unknown flag |
FWIW, a similar report was filed under #12754 which I just closed. |
Worked like the charm ! |
pip install TTS --use-deprecated=legacy-resolver Worked for me. |
As the name indicates this mode is legacy and depreciated. Please be aware that it could be removed in a future version of pip and moreover it does not guarantee a compatible installation. |
Description
Can't make pip installation of TTS package.
TTS
related issue: coqui-ai/TTS#3017Possibly related
pip
issues:#8380
#10473
Expected behavior
pip installation finishing without error messages
pip version
23.1.2
Python version
Python 3.8.7 (tags/v3.8.7:6503f05, Dec 21 2020, 17:59:51) [MSC v.1928 64 bit (AMD64)] on win32
OS
Windows 7 Home Premium, 64 bits
How to Reproduce
Run the following command:
pip install TTS
Wait (1-2 hours ... is this normal?)
See error message:
pip._vendor.resolvelib.resolvers.ResolutionTooDeep: 200000
Output
pip install TTS
command and it took hours again, despite all packages were already available so it was not a slow network problem (i.e. now all "Downloading whatever-package.whl" messages were "Using cached whatever-package.whl" instead).But installation stopped at the same point with same error message:
pip._vendor.resolvelib.resolvers.ResolutionTooDeep: 200000
Code of Conduct
The text was updated successfully, but these errors were encountered: