Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python virtualenv pip install MySQL-Python causing "RuntimeError: maximum recursion depth exceeded"

I setup a virtualenv and then tried to install MySQL-Python using pip (after activating env). My requirements.txt is as following:

MySQL-python==1.2.5
argparse==1.2.1
pymongo==2.6.3
wsgiref==0.1.2

When I run pip install -r requirement.txt. I get some output last line of which is:

RuntimeError: maximum recursion depth exceeded

As mentioned in a post, I even ran this command to upgrade my distribute:

easy_install distribute==0.6.28

Even that didn't work. My python version (in env) is 2.7.6 and Machine is Ubuntu 14.04


UPDATE: Stack trace is as following:

Downloading/unpacking MySQL-python==1.2.5 (from -r requirements.txt (line 1))
  Running setup.py (path:/root/frrole_backend_raw_dump/env/build/MySQL-python/setup.py) egg_info for package MySQL-python
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/root/frrole_backend_raw_dump/env/build/MySQL-python/setup.py", line 21, in <module>
        setuptools.setup(**metadata)
      File "/usr/lib/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 225, in __init__
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 257, in finalize_options
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2029, in require
        self.name = name
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 580, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 825, in best_match
        ``installer(requirement)``, unless `installer` is None, in which case
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 837, in obtain
        def __iadd__(self, other):
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 272, in fetch_build_egg
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 225, in __init__
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 257, in finalize_options
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2029, in require
        self.name = name
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 580, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 825, in best_match
        ``installer(requirement)``, unless `installer` is None, in which case
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 837, in obtain
        def __iadd__(self, other):
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 272, in fetch_build_egg
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 225, in __init__
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 257, in finalize_options
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2029, in require
        self.name = name
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 580, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 825, in best_match
        ``installer(requirement)``, unless `installer` is None, in which case
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 837, in obtain
        def __iadd__(self, other):
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 272, in fetch_build_egg
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 225, in __init__
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 257, in finalize_options
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 2029, in require
        self.name = name
      File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 580, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
like image 725
VaidAbhishek Avatar asked Mar 25 '14 08:03

VaidAbhishek


1 Answers

Getting this too!

Some notes from my setup:

  • Ubuntu 13.10
    • Python-MySQLdb and libmysqlclient-dev are both installed via apt-get

I also see this, which I suspect is the root cause:

x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’

EDIT:

Looks like I still get this (MySQL-Python 1.2.4) without a CFLAGS or CPPFLAGS environment variable set. 1.2.5 works for me.

like image 92
pnovotnak Avatar answered Oct 23 '22 05:10

pnovotnak