Open abubelinha opened 10 months ago
Can you try doing pip install TTS --log out.txt
and post the complete out.txt file in gist.github.com/new and share the resulting Gist link?
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.
23.1.2
Also, please attempt that with the latest pip release.
Thanks @pradyunsg I'm doing that now, but it takes hours. Is this normal? I don't use to see such a long process with most pip installations I have tried in the past
No, that's abnormal -- but given the error you're reporting, that's not surprising. ResolutionTooDeep
only occurs if there's over 200,000 packages in the graph OR there is a pathological dependency graph presented to the resolver.
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:
> python -m pip install TTS==0.17.6
ERROR: Ignored the following versions that require a different python version: 0.15.0 Requires-Python >=3.9.0, <3.12; 0.15.1 Requires-Python >=3.9.0, <3.12; 0.15.2 Requires-Python >=3.9.0, <3.12; 0.15.4 Requires-Python >=3.9.0, <3.12; 0.15.5 Requires-Python >=3.9.0, <3.12; 0.15.6 Requires-Python >=3.9.0, <3.12; 0.16.0 Requires-Python >=3.9.0, <3.12; 0.16.1 Requires-Python >=3.9.0, <3.12; 0.16.3 Requires-Python >=3.9.0, <3.12; 0.16.4 Requires-Python >=3.9.0, <3.12; 0.16.5 Requires-Python
>=3.9.0, <3.12; 0.16.6 Requires-Python >=3.9.0, <3.12; 0.17.0 Requires-Python >=3.9.0, <3.12; 0.17.1 Requires-Python >=3.9.0, <3.12; 0.17.2 Requires-Python >=3.9.0, <3.12; 0.17.4 Requires-Python >=3.9.0, <3.12; 0.17.5 Requires-Python >=3.9.0, <3.12; 0.17.6 Requires-Python >=3.9.0, <3.12
ERROR: Could not find a version that satisfies the requirement TTS==0.17.6 (from versions: 0.0.9a9, 0.0.9a10, 0.0.9, 0.0.9.1, 0.0.9.2, 0.0.10.2, 0.0.10.3, 0.0.11, 0.0.12, 0.0.13.1, 0.0.13.2, 0.0.14.1, 0.0.15, 0.0.15.1, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.2.2, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.8.0, 0.9.0, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.11.1, 0.12.0, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.14.0, 0.14.2, 0.14.3)
ERROR: No matching distribution found for TTS==0.17.6
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:
> python -m pip install TTS==0.17.6
...
Successfully installed Babel-2.12.1 GitPython-3.1.37 Jinja2-3.1.2 MarkupSafe-2.1.3 PyWavelets-1.4.1 TTS-0.17.6 Werkzeug-3.0.0 absl-py-2.0.0 accelerate-0.23.0 aiohttp-3.8.5 aiosignal-1.3.1 anyascii-0.3.2 appdirs-1.4.4 async-timeout-4.0.3 attrs-23.1.0 audioread-3.0.1 bangla-0.0.2 blinker-1.6.2 bnnumerizer-0.0.2 bnunicodenormalizer-0.1.6 cachetools-5.3.1 certifi-2023.7.22 cffi-1.16.0 charset-normalizer-3.3.0 clean-fid-0.1.35 click-8.1.7 clip-anytorch-2.5.2 colorama-0.4.6 contourpy-1.1.1 coqpit-0.0.17 cycler-0.12.0 cython-0.29.30 dateparser-1.1.8 decorator-5.1.1 docker-pycreds-0.4.0 docopt-0.6.2 einops-0.6.1 encodec-0.1.1 filelock-3.12.4 flask-2.3.3 fonttools-4.43.0 frozenlist-1.4.0 fsspec-2023.6.0 ftfy-6.1.1 g2pkk-0.1.2 gitdb-4.0.10 google-auth-2.23.2 google-auth-oauthlib-1.0.0 grpcio-1.59.0 gruut-2.2.3 gruut-ipa-0.13.0 gruut-lang-de-2.0.0 gruut-lang-en-2.0.0 gruut-lang-es-2.0.0 gruut-lang-fr-2.0.2 huggingface-hub-0.17.3 idna-3.4 imageio-2.31.4 importlib-metadata-6.8.0 importlib-resources-6.1.0 inflect-5.6.2 itsdangerous-2.1.2 jamo-0.4.1 jieba-0.42.1 joblib-1.3.2 jsonlines-1.2.0 jsonmerge-1.9.2 jsonschema-4.19.1 jsonschema-specifications-2023.7.1 k-diffusion-0.0.16 kiwisolver-1.4.5 kornia-0.7.0 lazy-loader-0.3 librosa-0.10.0 llvmlite-0.40.1 markdown-3.4.4 matplotlib-3.7.3 mpmath-1.3.0 msgpack-1.0.7 multidict-6.0.4 networkx-2.8.8 nltk-3.8.1 num2words-0.5.12 numba-0.57.0 numpy-1.22.0 oauthlib-3.2.2 packaging-23.1 pandas-1.5.3 pathtools-0.1.2 pillow-10.0.1 platformdirs-3.10.0 pooch-1.7.0 protobuf-4.24.3 psutil-5.9.5 pyasn1-0.5.0 pyasn1-modules-0.3.0 pycparser-2.21 pynndescent-0.5.10 pyparsing-3.1.1 pypinyin-0.49.0 pysbd-0.3.4 python-crfsuite-0.9.9 python-dateutil-2.8.2 pytz-2023.3.post1 pyyaml-6.0.1 referencing-0.30.2 regex-2023.8.8 requests-2.31.0 requests-oauthlib-1.3.1 resize-right-0.0.2 rpds-py-0.10.3 rsa-4.9 safetensors-0.3.3 scikit-image-0.21.0 scikit-learn-1.3.0 scipy-1.11.3 sentry-sdk-1.31.0 setproctitle-1.3.2 six-1.16.0 smmap-5.0.1 soundfile-0.12.1 soxr-0.3.6 sympy-1.12 tensorboard-2.14.1 tensorboard-data-server-0.7.1 threadpoolctl-3.2.0 tifffile-2023.9.26 tokenizers-0.13.3 torch-2.0.1 torchaudio-2.0.2 torchdiffeq-0.2.3 torchsde-0.2.6 torchvision-0.15.2 tqdm-4.64.1 trainer-0.0.31 trampoline-0.1.2 transformers-4.33.3 typing-extensions-4.8.0 tzdata-2023.3 tzlocal-5.0.1 umap-learn-0.5.4 unidecode-1.3.7 urllib3-2.0.5 wandb-0.15.11 wcwidth-0.2.8 yarl-1.9.2 zipp-3.17.0
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:
requirement=numpy==1.21.6; python_version < "3.10", parent=tts=0.14.3
requirement=numpy<2.0.0,>=1.22.3, parent=dctorch=0.1.2
requirement=numpy<2.0.0,>=1.19.0, parent=gruut[de,es,fr]=2.2.3
requirement=numpy!=1.22.0,!=1.22.1,!=1.22.2,>=1.20.3, parent=librosa=0.10.0.post2
requirement=numpy<1.22,>=1.18, parent=numba=0.55.1
requirement=numpy>=1.17, parent=umap-learn=0.5.1
requirement=numpy<1.27.0,>=1.19.5, parent=scipy=1.10.1
requirement=numpy<2,>=1.20, parent=matplotlib=3.7.3
requirement=numpy>=1.20.3; python_version < "3.10", parent=pandas=2.0.3
requirement=numpy>=1.17, parent=transformers=4.33.3
requirement=numpy<2.0,>=1.16; python_version <= "3.11", parent=contourpy=1.1.1
requirement=numpy>=1.13.3, parent=scikit-learn=0.23.2
requirement=numpy, parent=soxr=0.3.6
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:
requirement=numpy==1.21.6; python_version < "3.10", parent=tts=0.14.3
requirement=numpy<2.0.0,>=1.22.3, parent=dctorch=0.1.2
If Pip had prefered to backtrack on dctorch
in this step I think it would have much more quickly backtracked.
OK thanks @pradyunsg
Now trying with pip upgraded to 23.2.1 but it is not going faster.
Looks like this is going to fail again, but I'll submit the log when it finishes.
EDIT: failed again. Here is the log:
https://gist.github.com/abubelinha/500261fb0c26aa3070838e1c1e51d33a
Thanks @notatallshaw for all the explanations. My numpy version is 1.22.4 TTS page says it has been tested on Python >=3.7, <3.11 ... but Ubuntu, not Windows. I am afraid I cannot install Python>=3.9 on Windows 7, so I have the last version I can run on this machine (3.8.7).
Should I give up or do you think I could try to install an older version of TTS?
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 pypi-timemachine
, it sets the date of the index you're checking against to be any day in the past you want. As we know that TTS 0.14.3 was released on 2023-06-06 there's a good chance that if we set the date to 2023-06-07 it will install (and spoiler, it does).
So in one windows create a new virtual environment and install pypi-timemachine, e.g.:
python -m venv timemachine-venv
timemachine-venv\Scripts\activate
python -m pip install pypi-timemachine
pypi-timemachine 2023-06-07 --port 9999
Then in another Window with the Python environment you want to install TTS into activated:
python -m pip install TTS==0.14.3 --index-url http://localhost:9999 --disable-pip-version-check
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:
python -m pip freeze > constraints-tts.txt
And now you can run this any time you need to reinstall
python -m pip install TTS==0.14.3 -c constraints-tts.txt
Here's the output of pip freeze you can use directly from me if you's prefer
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 I'll try to give that a try
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:
python -m pip download -d downloads --only-binary ":all:" "numpy==1.21.6" "cython==0.29.28" "scipy>=1.4.0" "torch>=1.7" "torchaudio" "soundfile" "librosa==0.10.0.*" "numba==0.55.1" "inflect==5.6.0" "tqdm" "anyascii" "pyyaml" "fsspec>=2021.04.0" "aiohttp" "packaging" "flask" "pysbd" "pandas" "matplotlib" "trainer==0.0.20" "coqpit>=0.0.16" "pypinyin" "mecab-python3==1.0.5" "jamo" "bangla==0.0.2" "k_diffusion" "einops" "transformers"
I have the same problem, when conda create -n tts python=3.8
and pip install TTS
.
This bug is fixed when use conda create -n tts python=3.9
and pip install TTS
.
I think the bug is caused by python=3.8 version. Maybe the python version should not be python 3.8.
I think the bug is caused by python=3.8 version. Maybe the python version should not be python 3.8.
I've already explained the details of why it gets stuck on 3.8 but not 3.9 here: https://github.com/pypa/pip/issues/12305#issuecomment-1742127558
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 https://github.com/sarugaku/resolvelib/pull/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.
FYI for anyone wanting to reproduce,
In my experience it is a path-dependent bug, not easy to reproduce. For instance I had the ResolutionTooDeep
failure reproduced consistently (and stubbornly) when the following constrains were imposed, but only as part of a large (unpinned) requirements list (entire python packages list of the latestml/ml-cpu-py39-jup-cust
containers), while this stand-alone installation of these three conflicting packages succeeds with "only" the pip dependency resolver error:
$ pip install fastapi"<0.100.0" traitlets"<5.10.0" pandas-profiling
[..]
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.
fastapi 0.99.1 requires pydantic!=1.8,!=1.8.1,<2.0.0,>=1.7.4, but you have pydantic 2.5.3 which is incompatible.
$ pip show fastapi traitlets ydata-profiling | grep Name
Name: fastapi
Name: traitlets
Name: ydata-profiling
@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.
@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.
pip install git+https://github.com/notatallshaw/pip@prefer-conflicting-causes
@lwabish great to hear, do you have a reproducible example?
@lwabish great to hear, do you have a reproducible example?
@notatallshaw You can follow this to reproduce the problem. https://github.com/OpenTalker/SadTalker?tab=readme-ov-file#linuxunix
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.
@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.
pip install git+https://github.com/notatallshaw/pip@prefer-conflicting-causes
That works for me , thanks
That works for me , thanks
Good to hear, I am working on a PR (https://github.com/pypa/pip/pull/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?
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 TTS
this problem occurs
git clone https://github.com/OpenTalker/SadTalker.git
cd SadTalker
conda create -n sadtalker python=3.8
conda activate sadtalker
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
conda install ffmpeg
pip install -r requirements.txt
pip install TTS # boom!!!
Method 1: Using the --max-rounds flag
pip install --max-rounds 400000 TTS
Method 2: Setting the PIP_MAX_ROUNDS environment variable
export PIP_MAX_ROUNDS=400000
pip install TTS
Method 3: Editing the pip configuration file
[install]
max-rounds = 400000
@rolkey for me --max-rounds is unknown flag
Description
Can't make pip installation of TTS package.
TTS
related issue: https://github.com/coqui-ai/TTS/issues/3017Possibly related
pip
issues: https://github.com/pypa/pip/issues/8380 https://github.com/pypa/pip/issues/10473Expected 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