find_on_path distribution finder can cause "maximum recursion depth exceeded in comparison"
See original GitHub issueA few days ago someone filed an issue on pip’s tracker that looks like a setuptools issue: https://github.com/pypa/pip/issues/6288
Basically, it looks like the issue is that find_on_path()
(the “distribution finder” corresponding to pkgutil.ImpImporter
and FileFinder
) can get into a situation where it’s calling itself in an (infinite) recursive loop. Also, I believe this is happening in the find_on_path(only=False)
case, rather than only=True
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (6 by maintainers)
Top Results From Across the Web
What is the maximum recursion depth in Python, and how to ...
It works up to n=997 , then it just breaks and spits out a RecursionError: maximum recursion depth exceeded in comparison . Is...
Read more >maximum recursion depth exceeded in comparison ... - GitHub
find_on_path distribution finder can cause "maximum recursion depth exceeded in comparison" pypa/setuptools#1708.
Read more >Python maximum recursion depth exceeded in comparison
We can fix this error by either making our sequence iterative, or by increasing the recursion limit in our program. Solution #1: Use...
Read more >Maximum recursion depth exceeded while calling a Python ...
When working with Python properties, you might find yourself getting a “maximum recursion depth exceeded while calling a Python object” error.
Read more >maximum recursion depth exceeded in comparison
rst , and vise versa, second.rst includes index.rst . This creates circular reference that will quickly exhause Python recursion limit when Sphinx analyses ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into this problem today and found a solution for my case. My setup is probably different than the OP, but the errors appear to be the same.
I had a docker container w/ the following,
Purpose was so that the
.egg-link
doesn’t live under/src
and I can mount a src volume. Not doing this would overwrite the.egg-link
when mounting.Then, once in the container, trying to run any
pip install ...
returns thefind_path()
recursion failure. The problem was that I was usingdist-packages
, should have beensite-packages
(the latter of which didn’t initially exist in the container). Here’s what fixed the problem,The problem is, when the maintainers here run
pip install
, we don’t encounter the issue… so we’re kinda stuck investigating. I’ve tried runningpip install service-identity
on my Windows machine and it completes just fine. This all suggests to me there’s another issue at play here. We need to figure out what that is. Maybe you have symlinks installed. Maybe you’re in a directory that has settings configured. Maybe you have environment variables set. Maybe you’re behind a weird firewall. Maybe you’re running on an unprivileged account. We need to eliminate all these variables and hone in on what are the factors that lead to the failure you’ve encountered. Now that we have two people encountering the issue, perhaps we could compare environments to ascertain what things might be in common.cjerdonek has done some investigation trying to imagine what might be going wrong, but we don’t have a good way to confirm (or to ensure this doesn’t happen to someone else).
For next steps, I recommend trying another machine. If you’re on a work machine, find a personal machine (or vice versa) to try the same operation. Or try installing a clean version of Python (maybe try 3.7 instead of 3.6). Or find a friend and see if they encounter the same problem. Alternately, install a clean version of Windows into a VM and try that. Or even better, if you can reproduce the issue outside of Windows, that will vastly expand the audience of maintainers that will be able to help track down the issue.
Failing all of that, I recommend digging into the code when the failure occurs (add print statements or use pdb to break into the code and inspect the state. You’ll need to study the code enough to understand what it’s trying to do to know when the behavior diverges from that expectation.
Best of luck.