0

I am new to Python and am facing the below issue.

When I am trying to install the 'request' module by using command PIP install request, I got the error:

RuntimeError: maximum recursion depth exceeded

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\users\sandeep_kumar39\appdata\local\temp\pip-build-gzzphx\setupfiles\

The Python version is 2.7.12.

And I already upgraded the distribution package by using command pip install --upgrade distribute.

And upgraded the pip version too by using command pip install --upgrade pip

Complete output of error:

C:\Python27\Scripts>pip install request
Collecting request
  Using cached request-0.0.12.tar.gz
Collecting get (from request)
  Using cached get-0.0.20.tar.gz
Collecting post (from request)
  Using cached post-0.0.12.tar.gz
Collecting setupfiles (from request)
  Using cached setupfiles-0.0.16.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\sandeep_kumar39\appdata\local\temp\pip-build-3gsgdg\setupfiles\setup.py", line 4, in <module>
        from setupfiles import setup
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
            File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 18, in <module>
        import setupfiles # nopep8
      File "setupfiles.py", line 11, in <module>
        dirname = os.path.abspath(os.path.dirname(__file__))
      File "c:\python27\lib\ntpath.py", line 215, in dirname
        return split(p)[0]
      File "c:\python27\lib\ntpath.py", line 180, in split
        d, p = splitdrive(p)
    RuntimeError: maximum recursion depth exceeded

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\sandeep_kumar39\appdata\local\temp\pip-build-3gsgdg\setupfiles\
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
sandeep goyal
  • 11
  • 1
  • 6
  • give the full output of the error and the line that you execute, it will help – WNG Jun 01 '17 at 19:45
  • i have edited the question with complete output error. – sandeep goyal Jun 01 '17 at 20:44
  • 2
    Do you actually mean to install [request](https://pypi.python.org/pypi/request) and not [request**s**](https://pypi.python.org/pypi/requests)? – jwodder Jun 01 '17 at 20:57
  • Yes..i want to install request – sandeep goyal Jun 01 '17 at 21:02
  • Candidate canonical question: *[Python error when attempting to install 'request' package using pip](https://stackoverflow.com/questions/62930315/)* – Peter Mortensen Jun 20 '23 at 19:25
  • It might have been part of [an injection attack](https://stackoverflow.com/questions/76440240/getting-this-error-while-installing-the-request-module-of-python?noredirect=1&lq=1#comment134786828_76440240). – Peter Mortensen Jun 20 '23 at 19:26
  • One guide that contains the typo is *[New and Improved Mac OS Tutorial, Part 1 (The Basics)](https://passthroughpo.st/new-and-improved-mac-os-tutorial-part-1-the-basics/)*. But it is probably not the one used in this case. From *[Improving risks and consequences against typosquatting on pypi](https://discuss.python.org/t/improving-risks-and-consequences-against-typosquatting-on-pypi/5090)*. – Peter Mortensen Jul 03 '23 at 10:54

1 Answers1

2

This appears to be due to a bug in recent versions of setupfiles, upon which request depends. You can work around this by first installing version 0.0.14 of setupfiles with pip install setupfiles==0.0.14 before trying to install request.

jwodder
  • 54,758
  • 12
  • 108
  • 124
  • Thanks..its installed now :) – sandeep goyal Jun 01 '17 at 21:11
  • The first link is broken (404). – Peter Mortensen Jun 09 '23 at 13:25
  • A bug? You don't say. It is related to [this](https://stackoverflow.com/questions/51748121/i-am-trying-to-install-setupfiles-package-from-pip/52032994#52032994) (my emphasis): *"...a dependency on a package which might have been* ***put in PyPi maliciously"***. The blog post link is also broken, but its title was probably *"What is the story behind russianidiot on PyPI?"*. The larger issue is: *[PyPI Python repository hit by typosquatting sneak attack](https://nakedsecurity.sophos.com/2017/09/19/pypi-python-repository-hit-by-typosquatting-sneak-attack/)*. It is a problem to this day. - – Peter Mortensen Jun 09 '23 at 14:03
  • cont' - [Gibson](https://en.wikipedia.org/wiki/Security_Now) talked about it in February 2023 ([episode 912](https://twit.tv/shows/security-now/episodes/912)). – Peter Mortensen Jun 09 '23 at 14:06